In a (ugly) javascript I try to test if window.location.replace
  exists, before I use it:

  if(window.location.replace) window.location.replace(href);
  else window.location.href = href;

I remember trying to do something like that a while ago and finding what you found. Functions are objects, so you should be able to test for the availability of a function that way, but you can't.


I ended up just doing something like this:

        <script type="text/javascript" language="javascript1.1">
        // the replace() method used here
        </script>

        <script type="text/javascript" language="javascript">
        // the window.location method used here
        </script>

which is ugly but makes sense.




------------------------------------------------------------ "Have You Validated Your Code?" John Horner (+612 / 02) 9333 3488 Senior Developer, ABC Online http://www.abc.net.au/ ------------------------------------------------------------ ****************************************************** The discussion list for http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to