开发者

Browser "back" button directs to particular page

How can I set the "back" button in somebody's browser to direct to a pa开发者_JAVA百科rticular URL? I just want the back button to send back to the home page if on a different page.


don't think you can. Just imagine the fun malware writers would have if you could. That's a browser thing.


The litterature says it cannot be done http://www.w3schools.com/jsref/obj_history.asp


Because you cannot manipulate the back button directly, the way this problem is generally solved is by not letting things go into the browser history (and thus the back-button queue) that you don't want the back button to go to.

For example, you can go to a new link, but not have the new link replace the previous page in the back button queue by using window.location.replace(xxx) instead of just going to the new link normally.

If you use Ajax and change the page dynamically without changing the URL, then you can also have an interactive application that is not putting things in the back button queue (though there are sometimes other navigation issues with that).

If you describe more of the overall problem you're trying to solve, then folks may be able to offer additional ideas.


Not possible, the back button is just that, it takes you back. You can't go back to somewhere you haven't been


to my understanding, the browser's back and forward buttons only refer to the actual browsing performed by a client.

That can mean physical pages, or hashes. If using hashes, you can write ajax functionality to do that, but still, you'd be able to click back to other sites altogether.


It is not possible and Thanks god for that !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜