I\'m opening a new window into which I\'m injecting HTML for both the body and the head. The problem is in the head section: the HTML includes both the title and the favicon
You can open a new window using a data URI. Here's the code:
function Start() {
$('#TheButton').click(function() {
var TheNewWindow = window.open("data:text/html;charset=utf8,Title Works ");
});
}
$(Start);
And the fiddle.
Basically, data URIs allow you to specify the content in the URL itself such that it doesn't need to go to a server, or, in your case, to the "about:blank" resource browsers (must) have. "about:blank" can cause a lot of problems when scripting because of cross-origin and other concerns.
As noted by @ConnorsFan, this technique does not work in IE. As indicated in this question by Diego Mijelshon, IE does not allow navigation to a data URI, and thus it cannot be used as the URL for a new window. Seems to work fine in recent versions of Chrome and Firefox. I'm afraid I don't have a copy of Safari on which to test.