Solved

script src=

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now