Connecting Tech Pros Worldwide Help | Site Map

Javascript Hyperlink Function is Called Twice

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 2nd, 2008, 10:57 AM
Newbie
 
Join Date: Sep 2008
Posts: 4
Default Javascript Hyperlink Function is Called Twice

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
Reply
  #2  
Old September 2nd, 2008, 12:53 PM
RamananKalirajan's Avatar
Needs Regular Fix
 
Join Date: Mar 2008
Location: Chennai - India
Age: 24
Posts: 297
Default

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
Reply
  #3  
Old September 3rd, 2008, 01:40 AM
Newbie
 
Join Date: Sep 2008
Posts: 4
Default

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 10:25 AM. Reason: Removed link
Reply
  #4  
Old September 3rd, 2008, 10:26 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,236
Default

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

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
Reply
  #6  
Old September 12th, 2008, 10:47 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,236
Default

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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


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,840 network members.