I am attempting to prevent default anchor behavior in Safari using the jQuery library. Unfortunately, the standard techniques of returning false or using event.preventDefault() do not seem to be working in Safari.
Could anyone help me with this issue?
The code I’m working with is like this:
$('#main .green-tabs a').live("click",function(event){
$('.green-tabs a').removeClass('active');
$(this).addClass('active');
event.preventDefault();
var that = this;
return LolPage(event,that);});
Having the handler return
falseworks for me in Safari and FF and Chrome. See my test page here: http://gutfullofbeer.net/bind.html and it also works if I have the handlers call “preventDefault” instead of just returning false.The “LolPage” function is left out of your question, and I have to wonder whether that might be of great importance here.