jQuery confirmation not working in Chrome
I'm trying to create a basic confirmation box which prompts users with a simple confirm/cancel when they click on a link.
This is working fine in FF and IE, however Chrome just seems to ignore it.
Can anyone see why this might not be working?
//Confirm Duplication
$("a[href*=dupli开发者_JAVA百科cate]").click(function(event){
var answer = confirm("Duplicate?")
if(!answer){
event.preventDefault();
}
});
Any advice appreciated. Thanks.
I was able to fix a similar issue by changing the initial jquery call from
$().ready(function()
to
$(document).ready(function()
精彩评论