Invoking the location.replace() Method
<html> <head> <title>location.replace() Method</title> <script type="text/javascript"> function doReplace() { location.replace("http://www.java2s.com"); } </script> </head> <body> <form name="myForm"> <input type="button" value="Replace Me" onclick="doReplace()" /> </form> </body> </html>
1. | Assign a URL to location | ||
2. | Location replace | ||
3. | Location reload | ||
4. | Display properties in location | ||
5. | If location is a search, display its value | ||
6. | location.reload(true) and history.go(0) |