Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Include a js file from another js file
Message
From
06/05/2001 19:52:06
 
 
To
06/05/2001 15:03:26
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
00504023
Message ID:
00504045
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
>I have section in a javascript file that is generated by a robot. That is some javascript code. How can I include that portion of code in my javascript file?
>
>Basically, it's something like this:
>
>
>This is my main javascript file. It contains some code...
>
>Here, I need to include my javascript file generated by the robot.
>
>Rest of the main file code here...
>
Hi Michel,

Unfortunately, you cannot do that, javascript don't have instructions to include other files.
But, you may generate your javascript file on the server side using ASP and include there all what you need. Here is example:

somewhere in your HTML page:
< SCRIPT ... SRC="<B>generateScript.asp</B>">< /SCRIPT>
generateScript.asp
< %
Response.ContentType = "application/javascript"
Response.Expires = -1
%>
>This is my main javascript file. It contains some code...
>
>Here, I need to include my javascript file generated by the robot.

< !-- #include file="fileGeneratedByRobot.js" -->

>Rest of the main file code here...
HTH
Alex
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform