[jQuery] Finding ID within Ajax response
I have an ajax GET call that returns the HTML of a page on my server.
Within that page is a form with a specific ID. I know it is there, I
can see it in the response in Firebug, but when I try to get
attributes of that ID, it always returns undefined! What have I done
wrong here?
success: function(html){
$(html).find('#main_form').each(function() {
var linking_data = $(this).serialize();
var form_action = $(this).attr('action');
alert(form_action);
});
}
I have tried to not use each() and that still returns undefined. I
don't get it.