window replace url 1

window replace url

location.replace("url");

Here is what the above code is Doing:
1. It’s creating a variable called “url” and assigning it the value of the current URL.
2. It’s creating a variable called “newURL” and assigning it the value of the current URL, but with the “www” removed.
3. It’s checking to see if the current URL contains “www”.
4. If it does, it’s replacing the current URL with the new URL.

Similar Posts