Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- parsing ajax responseText into JS DOM


Achernar - 11:00 pm on Apr 30, 2007 (gmt 0)


I've done a little test (just being curious ;) ).

function getResponse(e) {
div=document.createElement('div');
div.innerHTML=e.responseText;
alert(div.firstChild);
// use this to list all first-level elements.
//for (var i=0,c;c=div.childNodes[i];i++) alert(c.tagName)
alert(div.innerHTML)
}

All the elements are immediate childs of the div element (but <head> and <body> disappear).
IE get rids of everything that is not inside <body> (<head>, <title>, <meta>). Mozilla keeps what was inside the <head> element.


Thread source:: http://www.webmasterworld.com/javascript/3326649.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com