In my web app, a lot of functionality is exposed as links that have onclick handlers exposing that functionality but the actual link is set to javascript void(0) like so...
<a href="javascript:void(0)" onclick="myApp.callJen(1303, this)" rel="nofollow">Call Jennifer</a>
It seems these kind of links don't play nice when my app is injected into Single Page Applications (SPAs) like Backbone.js and Angular. Sometimes clicking on this links in such sites will go to an actual page not found (not sure why that happens).
Anyhow how should I replace such links for those sites?
Let us say using real URLs or buttons is not an option at this point.
Other posts have suggested something like this..
<a href="#!">Link</a>
Or this..
// Cancel click event
$('.cancel-action').click(function(){
alert('Cancel action occurs!');
});
a { cursor: pointer; color: blue; }
a:hover,a.hover { text-decoration: underline; }
<a class="cancel-action">Cancel this action</a>
I honestly don't like either of these, so can you suggest something better?