I have these two pages:
page1.html
http://vidasp.net/tinydemos/jquery-load-issue/page1.html
Seems like this is a Safari issue, but maybe not a bug (and may happen in other browsers):
jQuery uses the browser's .innerHTML property to parse the retrieved document and insert it into the current document. During this process, browsers often filter elements from the document such as
<html>, <title>, or <head>
elements. As a result, the elements retrieved by .load() may not be exactly the same as if the document were retrieved directly by the browser.
http://api.jquery.com/load/
I'm guessing that applies to anytime .load()
is used, not just when getting fragments. But I think it would be best, since you are pulling content into a <body>
element that it not include a <head>
tag?