Hello,
I am trying to have a link call my JavaScript function and have it work for all Internet Explorer and Netscape browsers. I have read that this can be accomplished by:
<a href="javascript:myfunction()">Click me</a>
where myfunction has already been defined inside <head>.
This works using IE but unfortunately doesn't work using NS 4.7 or NS 7.1. What appears to work using NS 4.7 and 7.1 is:
<a href="javascript:{;}" onclick="myfunction()">Click me</a>
Is the second approach a good one or is there a more universal way of doing this that works for all browsers?
Thank you in advance for any help.
Richard
I am trying to have a link call my JavaScript function and have it work for all Internet Explorer and Netscape browsers. I have read that this can be accomplished by:
<a href="javascript:myfunction()">Click me</a>
where myfunction has already been defined inside <head>.
This works using IE but unfortunately doesn't work using NS 4.7 or NS 7.1. What appears to work using NS 4.7 and 7.1 is:
<a href="javascript:{;}" onclick="myfunction()">Click me</a>
Is the second approach a good one or is there a more universal way of doing this that works for all browsers?
Thank you in advance for any help.
Richard