go to  ForumEasy.com   
JavaPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » JavaScript » window.location.replace vs. window.location =
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: window.location.replace vs. window.location =
WebSpider
member
offline   
 
posts: 147
joined: 06/29/2006
from: Seattle, WA
  posted on: 02/09/2011 07:48:18 PM    Edit  |   Quote  |   Report 
window.location.replace vs. window.location =
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.

 Profile | Reply Points Earned: 0

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