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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

include a js

Status
Not open for further replies.

stvchez123

Programmer
Apr 18, 2002
59
0
0
US
I am trying to insert some external .js's to help clean up the page. in this one, its just some rollover code. it worked when straight on the page, so thats step one. I added this code:

<script language="JavaScript1.2" src="
then, when I do a view-source, well, i'd immagine i'd see the actual javascript, so something's amiss. any assististance is appreciated
 
Your assumption is incorrect. Javascript includes are not like other server-side includes -- all you will see is that line of code. However, you will be able to access the functions in the file.

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
Becuase of this different type of include, using external JS files can cause some bizarre results. Especially if it takes more time to call the external JS than load the current HTML. And even more if objects are expected in the external JS to make the main page work correctly.

You might want to consider importing the external JS to a local JS. You can download the external JS by simply typing that path and filename into your browser address line.

ToddWW
 
ToddWWW:
I think, from the post, that stvchez123 is simply using an absolute path to his file. Regardless, it should not matter where the file is.

--Chessbot

"So it goes."
Kurt Vonnegut, Slaughterhouse Five
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top