You can also grab the style from your AJAX HTML, and insert it in the head. Here's some sample code. Tested in IE8 and Chrome.
function enable_embedded_styles(html) {
// Grab style content, and create new style element for it
// Works for first set of <style></style> tags in html
// Tested in IE and Chrome
if (typeof(html) === 'string') {
var beg = html.indexOf('<style>'),
end = html.indexOf('</style>');
if (beg !== -1 && end !== -1) {
var style = html.substr(beg + 7, end - 7 - beg); // everything between style tags
html = html.substr(end + 8); // everything after closing style tag
s = document.createElement('style');
s.setAttribute('type','text/css');
// For IE
if (s.styleSheet) {
s.styleSheet.cssText = style;
} // endif
// For every other browser
else {
s.appendChild(document.createTextNode(style));
} // endelse
// Append stylesheet to head
document.getElementsByTagName('head')[0].appendChild(s);
} // endif
} // endif
return html;
} // endfunction