Domik942,
<html>
<head>
<meta http-equiv=content-type content="text/html;charset=UTF-8" />
<title>test js page</title>
</head>
<body>
<div>the 1 tag</div>
<div>the 2 tag</div>
<div>the 3 tag</div>
<script>
var testHtml = '<html><head><title>second page</title></head><body><p>test script</p>'+
'<script>\n' +
'alert("Hello IE ?");' +
'<\/script>'+
'<div>the 7 tag</div><div>the 8 tag</div><div>the 9 tag</div></body></html>';
var htmlNew = document.createElement('html');
htmlNew.innerHTML = testHtml;
var htmlOld = document.querySelector('html');
document.replaceChild(htmlNew, htmlOld);
var scripts = document.querySelectorAll('script');
var len = scripts.length;
var n = 0;
(function loadScripts()
{ if(n < len) {
var el = scripts[n++];
var s = document.createElement('script');
if (el.text) {
s.text = el.text;
loadScripts();
} else {
s.onload = loadScripts;
s.src = el.src;
}
el.parentNode.replaceChild(s, el);
}
})()
</script>
<div>the 4 tag</div>
<div>the 5 tag</div>
<div>the 6 tag</div>
</body>
</html>