I fail to understand what the argument replace does. From the documentation:
Optional. If set, the history entry for the new document inherits the history entry from the document which opened this document
Doesn’t it mean that without replace the newly opened document will be added to history with its state?
This is how I’m opening it :
var newDoc = document.open("text/html");
newDoc.write(file);
newDoc.close();
And basically what I want is for the history buttons to remember those. I’ve been working with history.js and wondered if this could save me some time.
It seems you’re citing w3schools, which is not very reliable. The MDN documentation page doesn’t even mention that argument, and the W3C specification states that
document.opendoesn’t take any parameters (not even the content-type you’re passing as the first argument). So there’s not much hope that passing a value forreplaceis going to work cross-browser.That being said, what I understand from the cited excerpt is the exact opposite of what you said: if you pass
true, the new page will inherit the history of the opener document; if you don’t, it starts a new history thread. Makes sense?