Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery missing : after property id

$('#note').click({ $('#trigger').remove();

    $('#info').slideDown(4000, function(){
        $(this).fadeOut(40000);
    });
});

What I'm trying to do here is obvious. Sadly, when I try this piece of code, FireBug throws the following error: missing : after property id.

After trying to debug for some time, I saw that seemingly nothing is wrong. The highlighting shows correctly in my editor (Notepad++), and no previous error was found.

Thank you in advance for any help.

like image 852
Ben Avatar asked Sep 28 '26 14:09

Ben


1 Answers

click expects a function. You are trying to pass it a pseudo object-literal having an invalid syntax.

$('#note').click(function() { // pass a function to "click"
    $('#trigger').remove();

    $('#info').slideDown(4000, function(){
        $(this).fadeOut(40000);
    });
});
like image 57
Anurag Avatar answered Sep 30 '26 04:09

Anurag