Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript include question 1

Status
Not open for further replies.

stvchez123

Programmer
Apr 18, 2002
59
US
I have a bunch of javascript code in my HTML page that I need to include.

The code in my HTML page is:
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--#INCLUDE file=&quot;/js/headerJS.html&quot; -->
</SCRIPT>

I have the correct javascript file in the /js/ directory, but it doesn't seem to be working. I did a view - source, and see this:

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--#INCLUDE file=&quot;/js/headerJS.html&quot; -->
</SCRIPT>

did i miss anything?
 
Try:
Code:
<script language=&quot;JavaScript&quot; src=&quot;/js/headerJS.html&quot;></script>
instead.

Pete.


Web Developer / Aptrix CMS (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Sorry... that should have been:
Code:
<script language=&quot;JavaScript&quot; src=&quot;/js/headerJS.js&quot;></script>

Where the JS file contains your JavaScript functions - text/JavaScript - rather than an HTML document.

Pete.


Web Developer / Aptrix CMS (LWWCM) Specialist
w: e: Pete.Raleigh(at)lclimited.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top