Location replace : location « Javascript Objects « JavaScript DHTML






Location replace

  
    
<html>
<body>
<script language="JavaScript">
    function function1() {
        location.replace("http://www.java2s.com");
    }
</script>
<input type="button" value="Replace" onClick="function1();">
</body>
</html>

    
      
        
    
  








Related examples in the same category

1.Assign a URL to location
2.Location reload
3.Display properties in location
4.If location is a search, display its value
5.location.reload(true) and history.go(0)
6.Invoking the location.replace() Method