469,926 Members | 1,533 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,926 developers. It's quick & easy.

links javascript in firefox

oranoos3000
107 100+
hi
would you please help me,

i'm working one a site project that summary of the content is shown in the first page and users with click continue link can see content completely

i want to call a function with click continue link
show_content is the a function that inside call a ajax request and fetch complete content and return and this content is shown in the special part of the page

i write this code as follow

Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:show_content(3);" onClick="return false;">continue</a>
this code is run is IE correctly because in firefox dont
act

thanks alot for your help.
Oct 7 '10 #1
3 1342
gits
5,390 Expert Mod 4TB
the link should look like:

Expand|Select|Wrap|Line Numbers
  1. <a href="#" onclick="show_content(3); return false;">continue</a>
Oct 8 '10 #2
Atli
5,058 Expert 4TB
You can also do:
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:void(0);" onclick="show_content(3); return false;">continue</a>
That way you don't get the # added to the URL.
Oct 16 '10 #3
acoder
16,027 Expert Mod 8TB
Even better, make it into a proper link (for those without JavaScript) and the return false will take care of the link not being followed for those with JavaScript enabled.
Oct 18 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Dave Blair | last post: by
10 posts views Thread by andreister | last post: by
1 post views Thread by luckyroom505 | last post: by
10 posts views Thread by Michael7 | last post: by
8 posts views Thread by rhino | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.