Forum Moderators: phranque

Message Too Old, No Replies

Calling javascript from HTML

Same script on all pages currently

         

Essex_boy

4:19 pm on Oct 30, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Im sure this can be done, ive a small script that allows a pop up window to appear when someone clicks on teh link.

Now this script is on all of my pages and Id like to put 'em on a diet. The easiest way would be to remove this piece of code.

How would I call this script from outside of a HTMl page?

i.e this pop script will now be a stand alone file.

goodroi

5:02 pm on Nov 1, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Add this to the header of all the pages
<script language="javascript" type="text/javascript" src="yourfile.js"></script>

And place your js file in the root directory or if you don't want the search engines to read it place it in a directory that is blocked using robots.txt.