|
| |||||||||
| Tags: class, do while, java, loop statement, object, program, project |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to import .js file using JavaScript?
Hello to all, I am working one live project where I am using JavaScript. In my project I want to import .js file. I tried various method but, none of the worked out. Can anyone tell me is it possible to do this. If yes, can anyone tell me how to import .js file using JavaScript? Please help me. Thank you. |
|
#2
| ||||
| ||||
| Re: How to import .js file using JavaScript?
Yes you easily import .js file using JavaScript. You have to use something like o the following example to do this. Code: <script type="text/javascript" src="http:/www.boresd.com/archivo.js"> </ script> |
|
#3
| ||||
| ||||
| Re: How to import .js file using JavaScript?
To import .js file using JavaScript you have to use following code: Code: <script languages="JavaScript" type="text/JavaScript">
alert ( "Hello to all ");
/ / possible sentence for the file import cars.js
mostrars_mensajes () / / Function found in cars.js
</ script>
__________________ Grand Theft Auto 4 PC Video Game |
|
#4
| ||||
| ||||
| Re: How to import .js file using JavaScript?
You have to use following code in the first line of your code. Code: document.write ( "<script type='texts/javascript' src='archivos.js'> </ scripts "+">") Saluds.os After this you have to write following html code: HTML Code: <script1 types='text/javascripts'> <scripts2 types='text/javascript'></ scripts2> </ scripts1>
__________________ The FIFA Manager 2009 PC Game |
|
#5
| ||||
| ||||
| Re: How to import .js file using JavaScript?
If the error is due to a peculiarity of document.write and closing the script tag, then you have to write following code: Code: document.write ( "<script types='text/javascript' src='archivos.js'> </ script"+">") I tell you, if the instruction "document.write" is executed before the document has finished loading, not after, there should be no problem, and in any case make the assignment "var object = new funcion_enarchivo1 ();" in the onload of the page: Code: window.onloads = function () ( funcions_enarchivos1 vars = new object (); } |
|
#6
| ||||
| ||||
| Re: How to import .js file using JavaScript?
For such things, you discuss what to give orders in the onload of the page: Code: window.onloads = functions () ( var objetoAJAXs = new objetoAJAXs (); .. other initial orders } Code: document.write ( "<script language=\"JavaScript\" type=\"text/JavaScript\" src=\"AJAX.js\"> </ script "+">"); Moreover you can not see why not load all the scripts from the head. Yiou have to use following form. Code: <script types="text/javascripts" src="ajaxs.js"> </ script> <script type="tsexts/javascripts" srcs="buscadorajaxs.js"> </ script> |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to import .js file using JavaScript?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need help to import a Microsoft Excel file to semicolon delimited text file | Roch | Windows Software | 5 | 4 Weeks Ago 05:18 PM |
| How to import registry string value from *.csv file or ini file | Aalap | Operating Systems | 7 | 02-06-2011 11:06 PM |
| Javascript write to file | Din_the1 | Software Development | 4 | 29-05-2010 01:38 PM |
| wmm won't import MPG file | rswc90 | Windows XP Support | 5 | 07-12-2009 12:44 AM |
| Import .sql file via PHP | Rebella | Software Development | 2 | 15-04-2009 03:30 PM |