Solved

script src=

Posted on 1999-01-15
2
190 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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)

680 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