Connecting Tech Pros Worldwide Help | Site Map

Javascript Hyperlink Function is Called Twice

  #1  
Old September 2nd, 2008, 11:57 AM
Newbie
 
Join Date: Sep 2008
Posts: 4
I am using <a href="javascript:someFunction('someValue','someVal ue2')"> Click here </a>

But when i clicked on it, it actually call the "someFunction" function twice.
This only happen to Mozilla Browser. IE only called once.

Kindly advise what is wrong with this method?
10,000 Thank you!!

Regard,
Jason
  #2  
Old September 2nd, 2008, 01:53 PM
RamananKalirajan's Avatar
Needs Regular Fix
 
Join Date: Mar 2008
Location: Chennai - India
Posts: 343

re: Javascript Hyperlink Function is Called Twice


Hi Kai, I tried this code in IE as well as Mozilla I am getting that someFunction() called only once. can u please tell in which version of mozilla u got the call twice

Regards
Ramanan Kalirajan
  #3  
Old September 3rd, 2008, 02:40 AM
Newbie
 
Join Date: Sep 2008
Posts: 4

re: Javascript Hyperlink Function is Called Twice


Quote:
Originally Posted by RamananKalirajan
Hi Kai, I tried this code in IE as well as Mozilla I am getting that someFunction() called only once. can u please tell in which version of mozilla u got the call twice

Regards
Ramanan Kalirajan
Hi Ramanan,

Thanks for your prompt reply!

I tried both v2 and v3 of mozilla browser and both the same.
I had google-ing about this problem and realised that it happened to others too.
[removed link]
However, i cannot find a link which provide a workable solution.
Sorry, I am still new in web application deverlopment.
Hope to hear from you again soon!
Thank you.

Regards
Kai

Last edited by acoder; September 3rd, 2008 at 11:25 AM. Reason: Removed link
  #4  
Old September 3rd, 2008, 11:26 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,521
Provided Answers: 12

re: Javascript Hyperlink Function is Called Twice


Post the code for someFunction. As a general rule, you should put JavaScript in onclick and put a real URL in the href attribute.
  #5  
Old September 12th, 2008, 04:56 AM
Newbie
 
Join Date: Sep 2008
Posts: 4

re: Javascript Hyperlink Function is Called Twice


Quote:
Originally Posted by acoder
Post the code for someFunction. As a general rule, you should put JavaScript in onclick and put a real URL in the href attribute.

Hi Acoder,

Thanks for the help, i am a very new developer for my current company.
Thus, i don't have the right to review any of my company's codes to anyone.
I am very sorry for that... however, with the help of my senior developer, we found out that the problem is not lie in the javascript but the <frame> tag.
It called itself again when we have something like <frame src="">.
We have tried to put <frame src="#"> or <frame src="dummy.htm"> but none of the solution works. We will try again with other methods.
Thanks again for everyone who have help up. :)

Regards,
Jason
  #6  
Old September 12th, 2008, 11:47 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,521
Provided Answers: 12

re: Javascript Hyperlink Function is Called Twice


What does someFunction() do? Can you not just post the relevant part of the code?
Reply