Forum Moderators: phranque

Message Too Old, No Replies

Two scripts in one Javascript

Can I piggyback two together?

         

carfac

3:21 pm on May 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi:

Currently, I have a call to an external javascript from all my pages. It is called from the page like this:

<script type="text/JavaScript" src="http://www.mydomain.com/box.js"> </script>

box.js looks like this:

if (top.location!= location) {top.location.href = window.location.href}

Just a quick wing-ding to get my pages out of any boxes.

OK, so I am adding a new ad campaign that will need some Javascript in the headers...

Can I add this to box.js, or should I make a new call to a new script (called ad.js)?

If I an just add it to this script (which would be easiest), are there any special considerations I need to know, such as a seperator between the two scripts or anything?

Thanks!

Dave

korkus2000

3:27 pm on May 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can just copy the js and paste it into the other js file. It will work fine. I would want to keep an ad js seperate though. Since you will be dealing with money keeping them seperate will keep people from thinking you are trying something funny.

carfac

3:51 pm on May 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you Korkus!

dave