Monday, September 28, 2009

[jQuery] jquery not working on content loaded by ajax

I've got the following code:

$(document).ready(function() {
$("a.market").click(function (event) {
alert( $(this).attr("id") );
});
});

it works on a test link that i have in a div

<a href='#' class='market' id='1234'>Test</a>

But when I load new data (it's loaded by a menu in an iframe, and the
data loads perfectly to the parent div where the test link resides)
when I click on these links (which are identical in format), nothing
happens.

is there anything I'm missing?

No comments: