473,398 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Using javascript:function() in Netscape 4.x

All,

I am trying to use a URL to call some javascript to do something, which
is working fine in IE6 but using the same code in Netscape 4.79 I cannot
get it to work at all.

I get no errors, but no results either, Netscrape just sits there and
does nothing ?

Below is an emample of what I am attempting to do. I have had a search
through previous posts and tried to implement some of the suggested
solutions but non seem to provide me with a solution in Netscape, even
though all of the seem to work correctly in IE

Can anyone spot what I am doing wrong ?

Thanks for the help in advance.
Martin

file1.js

function GenerateURL()
{
alert('Hello');
}

example1.jsp

<script language="javascript" src="c:\file1.js"></script>
<html>
<body>
<a href="javascript:GenerateURL();">Example1</a>
<br><br>
<a href="javascript:void(0)" onclick="GenerateURL();return
false">Example2
<br><br>
<a href="javascript:GenerateURL();void 0">Example3</a>
<br><br>
<a href="javascript:void(0)" onclick="GenerateURL()">Example4</a>
<br><br>
<A HREF="#" onClick="GenerateURL()">Example5</a>
</body>
</html>

Note: It is split across the two files for a reason

Jul 20 '05 #1
1 3768
I wonder if it's the c:\ which is causing the problem. Put the JS file in
the same dir as the example1.jsp and just put
<script language="javascript" src="file1.js"></script>

Netscape on my machine when you view a file on the machine ina dir structure
displays file:///C|/ so the best way is to reference it either absolutly
(from the web server POV) or relative.
Hope that helps

Stu

"Martin O'Rourke" <Ma************@oracle.com> wrote in message
news:3F***************@oracle.com...
All,

I am trying to use a URL to call some javascript to do something, which
is working fine in IE6 but using the same code in Netscape 4.79 I cannot
get it to work at all.

I get no errors, but no results either, Netscrape just sits there and
does nothing ?

Below is an emample of what I am attempting to do. I have had a search
through previous posts and tried to implement some of the suggested
solutions but non seem to provide me with a solution in Netscape, even
though all of the seem to work correctly in IE

Can anyone spot what I am doing wrong ?

Thanks for the help in advance.
Martin

file1.js

function GenerateURL()
{
alert('Hello');
}

example1.jsp

<script language="javascript" src="c:\file1.js"></script>
<html>
<body>
<a href="javascript:GenerateURL();">Example1</a>
<br><br>
<a href="javascript:void(0)" onclick="GenerateURL();return
false">Example2
<br><br>
<a href="javascript:GenerateURL();void 0">Example3</a>
<br><br>
<a href="javascript:void(0)" onclick="GenerateURL()">Example4</a>
<br><br>
<A HREF="#" onClick="GenerateURL()">Example5</a>
</body>
</html>

Note: It is split across the two files for a reason

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Patrice | last post by:
Hi, I'm trying to use a javascript function passing a vb variable. I don't understand why it doesn't work. Can someone help me? Thanks in advance. Here is my javascript function used to...
5
by: David C. Holley | last post by:
How would I run a JavaScript function in a *.asp page and then pass the value returned to VBScript for further processing? ***Converting the function to VBScript is *NOT* an option.
4
by: Don | last post by:
I have a client page that employs hover buttons. They work just fine in IE. But, when using Netscape, they intermittently won't display. When they don't display, all that shows is a gray box the...
2
by: Nasir Wasim | last post by:
How can Access DIV Properties in Script while using Netscape 7.2. I want to use the div id with it's Visibility and left propertyin script but it's not working :-( Main File : ----------- ...
5
by: elsenraat_76 | last post by:
Hello! I was wondering if someone could help me out with a problem I'm having? I'm trying to input a javascript value into an anchor tag (from a function), but don't have an event to call the...
2
by: Jim Hammond | last post by:
The script function in the code below works fine when it is JavaScript, but when I try to use C#, the function doesn't get executed. <body MS_POSITIONING="GridLayout"> <form id="Form1"...
4
by: mantrid | last post by:
Can anyone see why the checkbox in the code below doesnt get ticked when the textbox is changed ***This javascript function is called in the textbox's onchange event to check it when it is...
6
by: Ajit Goel | last post by:
Hi; We have a Javascript function which I have been tasked to move to a CSharp class. This javascript function uses Regular expression extensively. This function has a string input parameter and...
1
by: santhoskumara | last post by:
I am using Internet Explorer browser, I want to know how to clear cache and cookies using javascript function or java, when each time the page is loaded. i know to do manually in IE using TOOLS...
10
by: evicailieva | last post by:
A have a php scrip where I call a JavaScript function. I don't know why, but it doesn't work. At the beginning, when I was writing the script it was working but now it's not. I don't know wхat to do....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.