?
Solved

script src=

Posted on 1999-01-15
2
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
jhurst earned 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
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 code hide show and toggles. 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…

718 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