[jQuery] Traversing to body element of ajax response
Hi, I am trying to set the id and class of my <body> to match the id
and class of a <body> tag returned in an AJAX response.
I added the following code to my AJAX call:
success: function(data, textStatus) {
jQuery("body").attr("class", $
(data).find("body").attr("class"));
jQuery("body").attr("id", $
(data).find("body").attr("id"));
}
But $(data).find("body") seems to resolve to an empty array.
$(data).find("#wrapper") also resolves to an empty array (it is the
first element below the body).
$(data).find("#navigation") on the other hand, will resolve correctly
(a couple of levels down).
Does anyone know how I could do this? I believe this a bug in jQuery..
but wanted to check here before I posted it to the dev mailing list..
Thanks,
Ali