JavaScript - Multiple signals received after click

Posted by Angelo A on Stack Overflow See other posts from Stack Overflow or by Angelo A
Published on 2012-10-22T22:58:11Z Indexed on 2012/10/22 23:00 UTC
Read the original article Hit count: 165

Filed under:
|

I'm creating a webapp using jQueryMobile. When I'm using the app and I click a button it runs the script multiple times.

For example:

I have a submit button:

<input type="submit" id="login-normal" value="Login" />

And I have this JavaScript for debugging on which this error occurs:

$("input#login-normal").live('click',function() {
     console.log("Test");
});

On the very first click it works (and it goes to another screen for example), but when I go back to that screen and I click again, it outputs multiple console.logs

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jquery-mobile