Change URL of a saved HTML file

Posted by Paul Camilleri on Stack Overflow See other posts from Stack Overflow or by Paul Camilleri
Published on 2012-09-06T03:29:35Z Indexed on 2012/09/06 3:38 UTC
Read the original article Hit count: 102

Filed under:
|

I am new to HTML so this question might sound a bit lame. Anyways I have a saved webpage on my desktop that when i open it in google chrome i want it to show a specific URL instead of its current location. Any ideas how i might get this to work? I tried using the history.pushState but i have no idea why it is not working. I created a simple page for now to test it:

<html>
<head>
<script>
function setURL()
{
    history.pushState("Test","page2", "www.test.com");
}
</script>
</head>
<body>

<button type="button" onclick="setURL()">Set Url</button>

</body>
</html>  

Any help would be greatly appreciated. Thank you

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html