469,927 Members | 1,720 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

document.open replace bug in IE7?

Hi all,

I wrote the script below in order to replace the current page with something else.
I also don't want an entry to be placed in the History object.

This works fine in all browsers except 1: Internet Explorer 7. For some reason the page is shown, but it seems the new page is inserted before the current page in the history, and not overwritten.

Any help would be greatly appreciated!

If you would like to see it for yourself, just copy & paste the code below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Document.open problem in IE7</title>
</head>
<body>
Dit is de huidige.
<input type="button" onclick="doOverwrite()">
<script>
function doOverwrite() {
document.open( "text/html", "replace" )
document.write("\<html>\<head>\<title>testing title\</title>\</head>\<body>This is the new body\</body>\</html>")
document.close()
}
</script>
</body></html>
Nov 23 '06 #1
1 2080
AricC
1,892 Expert 1GB
I didn't copy your code but if you want a new line in Javascript use /n
Nov 25 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Brett Baisley | last post: by
4 posts views Thread by Bernard | last post: by
1 post views Thread by adam lital | last post: by
11 posts views Thread by Tony | last post: by
4 posts views Thread by Charlie Brookhart | last post: by
10 posts views Thread by Antoine De Groote | last post: by
parshupooja
1 post views Thread by parshupooja | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.