Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Include a js file from another js file
Message
De
06/05/2001 19:52:06
 
 
À
06/05/2001 15:03:26
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00504023
Message ID:
00504045
Vues:
15
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform