开发者

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()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜