HTML DOM replace() Method
Definition and Usage
The replace() method replaces the current document with a new one.
Syntax
Example
The following example uses the replace() method to replace the current document:
<html>
<head>
<script type="text/javascript">
function replaceDoc()
{
window.location.replace("http://www.w3schools.com")
}
</script>
</head>
<body>
<input type="button" value="Replace document"
onclick="replaceDoc()" />
</body>
</html>
|
Try-It-Yourself Demos
Use the
replace() method of the location object
|
|
|