[thelist] Avoiding a redirect loop

Peter-Paul Koch gassinaumasis at hotmail.com
Mon Mar 19 07:58:46 CST 2001


>     That way, obviously, browsers that do javascript 1.1 will do the
>replace, and browsers that don't will change hrefs.

Hmmm....suppose you're right.

>     Since I know that you're an advocate of object detection, as I am, it 
>is
>tempting to write a script like this:
>
><script type="text/javascript">
>   <!--
>     window.location.replace ? window.location.replace("newpage.html") :
>window.location.href = "newpage.html" ;
>   // -->
></script>

This looks wonderful.

>     But alas, as I have pointed out previously, IE 4 and IE 5 throw >an 
>error -- obviously a browser bug (acknowledged by a Microsoft insider, 
>btw[1]). Microsoft fixed this in IE 5.5, but doing a browser-version check 
>first in order to test for the replace() method seems like big-time 
>overkill to me.

Sigh...

What happens if you check for if (!document.location.replace) ? I only have 
IE5.5 here, so I can't test it, but if it returns false in IE4/5, not an 
error or something weird, we might be back on the track.

ppk

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





More information about the thelist mailing list