[thelist] Using Location.href Vs location.replace

Nik Schramm n at industriality.com
Thu Mar 20 08:22:31 CST 2003


On 18.Mar.03 09:27 Scott Webster wrote

> hi guys
> 
> Where is the benefit in using     location.replace(url)
> 
> as opposed to     location.href = url.
> 
> AFAIK, usage of .replace is browser-dependant. Why 
> wouldn't you just use location.href? Is there a performance 
> benefit in using .replace?
> 
> thx
> 

location.replace() does NOT generate a new entry in the History object, 
unlike location.href, which does.

(Source: O'Reilly JSDG)

-- 
/nik



More information about the thelist mailing list