- As we know that location object contains information about the current URL.
- The location object has a method named replace() method that replace current document with another document.
Following are the main browsers which support the replace() method of location object
- Internet Explorer.
- Google Chrome.
The replace() method of location object has following syntax
Lets take an example
<body style ="background-color:yellow">
<input type="button" value="Replace site" onclick="replaceDoc()" />
When we click on button it repalce the current document with that document which we give in url as a parameter in method name.
You may also want to read these related articles :here
Ask Your Question
Got a programming related question? You may want to post your question here
Programming Answers here