[Zope] Check for JavaScript: (OT)

Stefan H. Holek stefan@epy.co.at
Fri, 3 Nov 2000 15:34:48 +0100 (CET)


> On Fri, 03 Nov 2000, Oleg Broytmann wrote:
> >
> > <html><head>
> > <script languagae=javascript>
> > window.location = "/site/with/js/"
> > </script>
> >
> > <meta http-equiv=refresh content="5; url=/site/nojs/">
> > </head><body>
> >
> > <p>Loading, please wait...</p>
> >
> > </body></html>

assigning to location.href breaks the history (the redirecting
page is added to the history and pressing back will get you to the redir
page and, voila, forward you again). annoying. try to use
location.replace() whenever possible. somehow like:

<script language=javascript>
<!--
    if ( !document.images ) 		// guard against pre js1.1 browsers
      window.location.href = '/with/js/';
    else 
      window.location.replace( '/with/js/' );
// -->
</script>

be aware also that having a redirecting start page will cause problems
for some (most?) spiders and your site will never show up in the search
engines.

regards,
stefan