href=“[removed]” vs. href=“[removed]void(0)”

前端 未结 8 682
[愿得一人]
[愿得一人] 2020-12-04 08:16

Our web app is rendered totally on the browser.
The server only talks to the browser through JSON messaging.

As a result, we only need a single page for the app

相关标签:
8条回答
  • 2020-12-04 09:16

    Why have all the click events as a href links?

    If instead you use span tags with :hover CSS and the appropriate onclick events, this will get around the issue completely.

    0 讨论(0)
  • 2020-12-04 09:19

    This method seems ok in all browsers, if you set the onclick with a jQuery event:

    <a href="javascript:;">Click me!</a>
    

    As said before, href="#" with change the url hash and can trigger data re/load if you use a History (or ba-bbq) JS plugin.

    0 讨论(0)
提交回复
热议问题