location.replace in function in java script code example Example: window replace url location.replace("url");