Tuesday, 17 September 2013

Returning to a page from window.location.href=url

Returning to a page from window.location.href=url

I have a web site builder with a Publish button that puts the constructed
web site out at a designated url. I would then like to perform the
courtesy of transferring the user to the built page. I can use
window.open(url), which opens a new window with the new site and leaves
the editor page in tact. So after seeing the built page the user can just
close it and be back in the editor to make more changes after seeing what
was built. This is the ideal solution, except that it doesn't work with
Safari because it blocks pop ups.
The other possibility is to execute window.location.href=url. This gets
the user to the new page but getting back to the editor and its previous
state is not clean. Hitting the back button from the new site reloads the
editor page without any of the state information the user had built up to
moment of publishing.
Is there a way I can get the user back to editor with the previous state
information displayed, that works for Firefox and Safari?
Thanks.

No comments:

Post a Comment