Hi,
I want to achieve the really easy task to replace the head node of a page with the head node of the page called with an ajax call.
I do it like this:
url = 'http://myurl';
$.get(url, function(results){
var head = $('head', results);
$('head', results).each (
function() {
alert("got a match ");
});
var form = $("form.ajax_form_result", results);
//update the ajax_form_result div with the return value "form"
$('head').html(head);
$('#ajax_form_result').html(form);
}, "html");
The form updates work without problems, but the head update does not work. $("head", results); does not return a node, resulting in an empty head in the new document.