go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  window.location.replace vs. window.location =
 
Subject: window.location.replace vs. window.location =
Author: WebSpider
Posted on: 02/09/2011 07:48:18 PM

Is there any difference between the last two lines?

<script language='JavaScript'>
     var url = "http://www.google.com/"; 
     window.location = url; 
     window.location.replace (url); 
</script>


The difference is how history is handled. "replace" won't give you the history.




References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.