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!

linked .js file doesn't work -- when downloaded it writes .js TEXT!

Status
Not open for further replies.

sarahmc22

Programmer
Nov 30, 2000
36
0
0
US
I have 2 linked .js files in an HTML page:

<script language=&quot;JavaScript src=&quot;mymenu.js&quot;>
</script>
<script language=&quot;JavaScript src=&quot;data.js&quot;>
</script>

When I browse the local copy of this HTML file or in FrontPage, the script works fine. (I have IE 6). But viewing the exact same online version, it doesn't work, and when I type in the name of the .js file in the URL window, it downloads the .js file and displays it as TEXT on the browser screen instead of interpreting the file...

Any ideas????

Many Thanks,

SM
 
<script language=&quot;JavaScript&quot; src=&quot;mymenu.js&quot;>
</script>
<script language=&quot;JavaScript&quot; src=&quot;data.js&quot;>
</script> someone knowledge ends where
someone else knowledge starts
 
Sorry, I copied the tag wrong. It reads correctly in the HTML file. Like I said, the script works locally fine...
 
and when I type in the name of the .js file in the URL window, it downloads the .js file and displays it as TEXT on the browser screen instead of interpreting the file...


of course u need to ask for a .html doc
<html>
<head></head>
<body>
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;path.js&quot;></script>
</body>
</html>

a page cannot consist of javascript only someone knowledge ends where
someone else knowledge starts
 
The point is this: the browser upon downloading the .js file should interpret the .js file - not display the contents of the file.

Why does my browser interpret the .js file when downloaded locally, but not when downloaded from a server????????
 
cause YOUR AND ONLY YOUR browser
is set to interpret js as html someone knowledge ends where
someone else knowledge starts
 
But my browser DOES interpret all .js files except this one when downloaded from a server.
 
I'll find the answer myself -- don't worry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top