Hi,
i try to get a json list and append it
$.getJSON("url",
function(data){
$('#tbl').append("<li id="listitem">asd</li>);
});
It works but i cant access the li object with
$("#listitem").hover( alert("Hover"); );
`
Hi,
i try to get a json list and append it
$.getJSON("url",
function(data){
$('#tbl').append("<li id="listitem">asd</li>);
});
It works but i cant access the li object with
$("#listitem").hover( alert("Hover"); );
`
Try with livequery plugin. It should help in these case. Try something like this:
$('#tbl').append("<li id="listitem">asd</li>).livequery( 'hover', doMagic() );
This should work
$("#listitem").hover( function() {alert("Hover");} );
hover expects an anonymous function or a callback.