jQuery code doesn't work when normally run. But i does with breakpoints activated.

Posted by Dante on Stack Overflow See other posts from Stack Overflow or by Dante
Published on 2010-04-20T22:03:34Z Indexed on 2010/04/20 22:13 UTC
Read the original article Hit count: 242

Filed under:
|
|

Hi,

I have the following code in my application:

$(".deleteproduct").click(function() {
    id = this.id;
    alert("id: " + id);
});

If i run my site nothing happens when I click on an element with the class deleteproduct. But when I place breakpoints before line 1,2 and 3 it works like a charm.

The elements with class deleteproduct are loaded through AJAX call right behind $(document).ready(function(). The .click code is underneath it.

This seems really weird to me. It's working if breakpoints in Firebug are used, but not when there are not...

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about firebug