Dan Stern
Dan Stern

Reputation: 2167

href= javascript: jquery not working in FF

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

Answers (3)

Ashwin Singh
Ashwin Singh

Reputation: 7375

Did you try returning false?

<a href="javascript: $('#dash-main').load('billing.php'); return false;">text</a>

Upvotes: -3

iambriansreed
iambriansreed

Reputation: 22261

Use onclick and avoid the problem:

<a href="#" onclick="$('#dash-main').load('billing.php');return false;">text</a>

Upvotes: 10

Samson
Samson

Reputation: 2821

Why not use:

<a href="#" onclick="$('#dash-main').load('billing.php')">text</a>

Cross-browser compatible!

Upvotes: 4

Related Questions