Solved

script src=

Posted on 1999-01-15
2
186 Views
Last Modified: 2010-04-09
I decided long ago, based on something I read, that <script src= > cannot be used with Netscape 3.x (NS3).
But today I noticed that MS is using it succesfully on its site. When my own html says src=http:/www.microsoft... it does indeed work.
But if I copy the script (*x.js) to my web and try to use that with src=..., NS3 asks me if I want to save the script file.
What gives? I would love to pull out my scripts to separate files, since I use them from many pages.
CW
0
Comment
Question by:syccwe
2 Comments
 
LVL 8

Accepted Solution

by:
jhurst earned 100 total points
ID: 1841713
The
<script src=xxx.js>
</script>

tags need to specify xxx.js as being the path where the javascript is to be loaded from.  However, this is assumed to be relative to the path where the html loaded from.  So typically you need the script file and the html in the same place.    For example:

The html file:
<html>
<body>
<script src=test.js>
</script>
</body>

and the file test.js:
alert('This will pop up');

would cause the alert box to appear if these were both placed in the same directory on your server.

I placed these two files at:
http://www.REsource.nu/bugs/test.htm
and
http://www.REsource.nu/test.js
for your interest




0
 

Author Comment

by:syccwe
ID: 1841714
I did give the path. The problem seems to be, that for some reason, NS3 and my test web server(IIS3) don't match. On my production server, and your test page, I have an intermittent problem: NS doesn't execute the script but instead displays nothing from the loading page, but the *script source* instead! Other browsers are just fine!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question