开发者

What's wrong with my JQuery syntax here?

开发者 https://www.devze.com 2023-03-04 04:43 出处:网络
This code is throwing me a syntax error: $(\"body\").live(\"click\", (function(){ i开发者_如何学Pythonf ((! mouse_is_inside) && ($(\"div#notification_box\").is(\":visible\"))) {

This code is throwing me a syntax error:

$("body").live("click", (function(){ 
        i开发者_如何学Pythonf ((! mouse_is_inside) && ($("div#notification_box").is(":visible"))) {
           $("div#notification_box").hide();
           $("p.exclamation").removeClass("exclamation_hover");
           $.ajax("/videos/update_box.js");
      }     
    });


Remove the ( before function. You have mismatched parentheses.


You have an extra ( right before 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");
  }     
});
0

精彩评论

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

关注公众号