user730569
user730569

Reputation: 4004

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");
      }     
    });

Upvotes: -3

Views: 60

Answers (2)

Bryan Drewery
Bryan Drewery

Reputation: 2636

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");
  }     
});

Upvotes: 0

Kelly
Kelly

Reputation: 41531

Remove the ( before function. You have mismatched parentheses.

Upvotes: 3

Related Questions