Connecting Tech Pros Worldwide Help | Site Map

Using javascript:function() in Netscape 4.x

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 09:51 AM
Martin O'Rourke
Guest
 
Posts: n/a
Default 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


  #2  
Old July 20th, 2005, 09:51 AM
Stuart Palmer
Guest
 
Posts: n/a
Default Re: Using javascript:function() in Netscape 4.x

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" <Martin.ORourke@oracle.com> wrote in message
news:3F4B7899.560957D8@oracle.com...[color=blue]
> 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
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.