Working on WinXP in FireFox 3.0.14 with JQuery 1.3.2, I'm trying the following code:
$.ajax({ url: "http://foo.bar/document" data: 'r=' + Math.random(), success: function(value) { var body = $(value).find('body'); // Always empty var form = $(value).find('form'); // Always empty var p = $(value).find('p'); // Actual paragraphs } }); Now, "body" and "form" are always empty, while "p" contains actual paragraphs. When I debug $(value) with Firebug, I see that it has become an array with some text nodes (whitespace), some link nodes (css) and a form node. The form node contains script nodes (although in the html, they occur in the head) and the content html. Now I'd like "body" and "form" to contain their respective counterpart from the newly loaded content, but, aside from doing some custom implementation, can I do that with JQuery in some way with a find? Obviously, the current find on body/form does not work, because it's applied iteratively on the array and it cannot find top-level element. The find('p') does work because they are not top-level within an array node. Regards, Grimace