What's wrong with my JQuery syntax here?
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");
}
});
精彩评论