How to redirect page in JavaScript
2013-06-05 17:15
316 查看
window.location= “xxx.html”; (or
window.location.href
= "xxx.html";)
window.location.replace("xxx.html")
NOTE: The second one is better than
the first one, because
replace()does not put the originating page in the session history, meaning the user won't get stuck in a never-ending back-button fiasco. If you want to simulate someone clicking on a link, use
location.href. If you want to simulate
an HTTP redirect, use
location.replace.
相关文章推荐
- how to add Javascript and CSS in page layout with sharepoint 2013
- How to redirect to login page after cookie expires in Angular JS?
- 转:How to create your own custom 404 error page and handle redirect in SharePoint 2007 (MOSS)?
- How to create your own custom 404 error page and handle redirect in SharePoint
- How to create your own custom 404 error page and handle redirect in SharePoint 2007 (MOSS)?
- How to implement scrolling image with javascript in web page
- How to redirect to a Custom Page for Event Receiver in SharePoint 2010
- How to overwrite the method in Javascript
- how to call javascript function in webview
- How to add custom fields to Customer Registration and Account page in magento
- How to set the DefaultButton in a Page Based on ASP.NET Master Page
- How to copy files between sites using JavaScript REST in Office365 / SharePoint 2013
- [JavaScript] How to use HightLight in Dojo?
- How to Get All Product Images in products list page?
- [连载]Tutorial series: learning how to write a 3D soft engine from scratch in C#, TypeScript or JavaScript[英]
- How to Turn On “About This Page” in Oracle R12 OAF Pages
- [HTML] how to redirect to another page automactilly without js
- How to programmatically assign a SkinID to a control while using a master page in ASP.net 2.0
- How to call code behind method in JavaScript in C# and VS2010?
- (C#) A demo on how to auto fill out the "account" value in log in web page in "WebBrowser" control.