Reputation: 2167
I have an anchor that triggers a javascript which uses jquery:
<a href="javascript: $('#dash-main').load('billing.php')">text</a>
This anchor works fine in Chrome, and even in IE, but when I use it in FF, the browsers redirects to "http://javascript: $('#dash-main').load('billing.php')".
Any idea what is wrong?
Upvotes: 3
Views: 5868
Reputation: 7375
Did you try returning false?
<a href="javascript: $('#dash-main').load('billing.php'); return false;">text</a>
Upvotes: -3
Reputation: 22261
Use onclick and avoid the problem:
<a href="#" onclick="$('#dash-main').load('billing.php');return false;">text</a>
Upvotes: 10
Reputation: 2821
Why not use:
<a href="#" onclick="$('#dash-main').load('billing.php')">text</a>
Cross-browser compatible!
Upvotes: 4