Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to access include variable from another include
Message
 
To
08/01/2006 23:59:25
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
01084610
Message ID:
01084792
Views:
10
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform