[Javascript] Calling a JS Library from another JS library

LaMonte Forthun lamontef at affiliateclick.com
Wed Jan 16 18:32:54 CST 2002


Hi all,

I have just joined the list and have to apologize in advance for asking a
question you may have covered a thousand times before (although, I did pour
through 38mb of archived messages from the past few years and didn't get my
answer, so maybe not...). What's mostly odd about this is that everything
works fine on a Mac, but not on a PC.

My project consists of a JS file that determines which particular ad
(pop-under) is suppose to run when a visitor comes to a member site (I have
many sites running my ads, which is why I'm looking to do what I'm
explaining). What I need to do is have one JavaScript (this is a library off
a first JS file that does an initial conditional check, if that condition is
met, this library is loaded) that acts as a shell and has multiple
conditions depending on a random number that is generated. The second
library selects that random number and which ad is going to run. This file
changes on a daily basis for a number of clients, so I want it separate from
the main file so I can change just one file. The third library is actually a
series of libraries that have the information regarding the actual popunder
that is shown as well as the tracking information for that ad. These also
change regularly so I want them separate. I know I can load one library from
within another because before I separated the main script, I was calling it
from the first library if the first condition was met. The problem is, the
variable that is set in the second script based on the random number isn't
getting set right and comes back as undefined, but only on PCs, it works
fine on a Mac, as I mentioned earlier.

I'm guessing that this is a global vs. local variable problem, but I really
don't know. I'm curious if included files work three levels deep, and how I
should set up and declare my variables.

Any help would be appreciated...

Thanks much

LaMonte Forthun 



More information about the Javascript mailing list