I asked at Parsing HTML String with jQuery how I can use jQuery on an html string. That all works, but when I apply it to ajax - it does not work. Here is the code.
<script>
var url = 'moo.html';
$.ajax({
url: url,
success: function ( code )
{
html = $(code);
html.each(function() {
alert( $(this).html() );
});
}
});
</script>
moo.html contains
<div id='test'>zebra</div>
<div id='foo'>bar</div>
How can I get zebra and bar?