I asked at http://stackoverflow.com/questions/1529333/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?