简体   繁体   English

我的JQuery语法在这里有什么问题?

[英]What's wrong with my JQuery syntax here?

This code is throwing me a syntax error: 这段代码使我陷入语法错误:

$("body").live("click", (function(){ 
        if ((! mouse_is_inside) && ($("div#notification_box").is(":visible"))) {
           $("div#notification_box").hide();
           $("p.exclamation").removeClass("exclamation_hover");
           $.ajax("/videos/update_box.js");
      }     
    });

删除( before function 。括号不匹配。

You have an extra ( right before function(){ 您有一个额外的(function(){之前function(){

Here is the proper code: 这是正确的代码:

$("body").live("click", function(){ 
    if ((! mouse_is_inside) && ($("div#notification_box").is(":visible"))) {
       $("div#notification_box").hide();
       $("p.exclamation").removeClass("exclamation_hover");
       $.ajax("/videos/update_box.js");
  }     
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM