javascript - href=javascript : jquery not working in FF

标签 javascript jquery firefox anchor

我有一个触发使用 jquery 的 javascript 的 anchor :

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

这个 anchor 在 Chrome 中工作正常,甚至在 IE 中也能正常工作,但是当我在 FF 中使用它时,浏览器会重定向到“http://javascript: $('#dash-main').load('billing.php ')".

知道哪里出了问题吗?

最佳答案

使用onclick 避免问题:

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

关于javascript - href=javascript : jquery not working in FF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11809903/

相关文章:

javascript - 在函数中引用父作用域,泄漏的可能性?

javascript - HTML 视频层上方的上下文菜单变得不可点击

javascript - 反转jquery中滑动div的循环

javascript - 在 HTML 表格中查找 td 旁边的 td 文本

javascript - Postman 测试检查部分对象值

javascript - 使用 jquery 将数据发送到 MVC Controller

jquery - 无法引用动态添加的 jQuery Mobile 元素

javascript - 火狐大纲 :none on input text is not working

google-maps - IndexSizeError 使用谷歌地图 v3 : using google. maps.Marker

css - DIV 在 Firefox 3.5 (Mac) 上未按预期对齐