Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need to access include variable from another include
Message
 
À
08/01/2006 23:59:25
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
01084610
Message ID:
01084792
Vues:
9
>I have a HTML page which includes a javascript file. So, this HTML page looks like this:
>
>
><P>
>This is my Html.
></P>
><script language=JavaScript src=http://www.mywebsite.com/Javascript/Banner.js></script>
>
>
>Banner.js includes the following, which is mostly a bunch of document.write to create some content on the page:
>
>
>document.write("<script language=JavaScript src=http://www.mywebsite.com/Images/MarketingTool/Banner400x77.js></script>")
>if ((nType==1) || (nType==2))
>{
>   alert("1")
>}
>
>
>What I am trying to resolve is to make nType variable visible in Banner.js but I can't because it is initialized in Banner400x77, which is an include .js file and it won't take effect until Banner.js is finished processing. Anyone would know how I can have nType variable visible from Banner400x77.js while I am still inside Banner.js?

Have you tried:
nType=0;
document.write("<script language=JavaScript src=http://www.mywebsite.com/Images/MarketingTool/Banner400x77.js></script>")
if ((nType==1) || (nType==2))
{
   alert("1")
}
Ricardo A. Parodi
eSolar, Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform