Forum Moderators: open

Message Too Old, No Replies

can code be referenced from another file?

         

Sothpaw

1:07 pm on Jun 22, 2007 (gmt 0)

10+ Year Member



i have a series of javascript that is exactly the same on numerous pages of mine.
can i reference it from another file like how CSS works?
or do i have to have the entire code on every page that requires it?

Arno_Adams

2:01 pm on Jun 22, 2007 (gmt 0)

10+ Year Member



Hi,

just move them to a file called functions.js and include them like this:


<script type="text/javascript" src="scripts/functions.js"></script>

HTH, AA

Sothpaw

2:08 pm on Jun 22, 2007 (gmt 0)

10+ Year Member



that's exactly the answer i was looking for.
thanks a mil.