How to use assign method to location object in Javascript
Assign value to location
Passing in a URL to location.assign()
method starts the process of navigating to the new URL and
makes an entry in the browser's history stack.
Example
<!DOCTYPE HTML>
<html>
<body>
<script>
document.location.assign("http://java2s.com");
</script>
</body>
</html><!--from ww w . ja va 2 s . c o m-->