When you load an html document using AJAX, what does it do with the nodes inside the HEAD tag: (script,link,style,meta,title) ignore them or load and parse them? And in the
when you load an html document using AJAX, what does it do with the nodes inside the HEAD tag: (script,link,style,meta,title)
That depends how you do the loading. ajax() (as with the XMLHttpRequest on which it is based) itself just gives you a string. How are you getting that into the document?
If you write that string to the innerHTML of an element, scripts inside it won't be executed. This is not standardised anywhere but all currently popular browsers behave this way.
However, if you then insert that element into the document (whether it was already inside the document before or not), it will be executed in many browsers, the first time you do it. In IE, the script will be executed when you directly insert a script element into any element, whether in the document or not.
This is all very inconsistent and inconvenient, which is why you should avoid AJAX-loading elements in the document. There is not usually a good reason to anyway; better to keep your script code static, and use JSON (or eval only if absolutely necessary) to pass scripting data to them.
jQuery's load function attempts to compensate for the browser differences when AJAX-loading content into the document. It fails to catch all circumstances involving (there are some really strange ones). You shouldn't rely on it, in general. You can get away with taking an HTML page response but then only loading specific element(s) with no in, because that only does the writing-to-innerHTML step. But again, you don't really want to be relying on this. Much better to have the server return a snippet of HTML or JSON your scripts can use directly.
As for stylesheets and stylesheet links, inserting them into the body does generally work, though by HTML's terms it probably shouldn't. meta and title won't do anything, it's too late for them to have an effect. Just parsing them using innerHTML won't do anything, but still, avoid it if you can.