Proper format: External Javascript file

D

Doug Stewart

I have some javascript that I would like to put into an external file, that
is referenced by my page. I've seen multiple explanations of how to do this.
Three examples:
<script language="javascript" type="text/javascript" src="xxx.js"></script>

<SCRIPT SRC="xxx.js" LANGUAGE="JavaScript"></SCRIPT>

<script src="xxx.js"></script>

What is the correct format? I've heard that if one uses the incorrect
format, that it might work in some browsers but not in others. As I can't
test all browsers, I'm hoping for advice on the correct way of doing this.

Do I just take the javascript currently in my page and stick it in a file,
or do I need to strip out the start and end? Again, the information I've seen
on this is not consistent.

Many thanks for any guidance.

Doug Stewart
 
S

Steve Easton

<script language="javascript" type="text/javascript" src="xxx.js"></script>

and the external file does "Not" contain the opening and closing script
tags,
but starts wit: .<!--

and ends with: //-->

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
S

Steve Easton

Make that
<!--
and
//-->


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top