Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: RE: I'm stuck in a loop and I can't get back......


Message #1 by "elin tjerngren. artopod" <elin@a...> on Thu, 1 Nov 2001 09:06:28 +0100
Thanks!  I replaced my statement as follows and it works great!

<script language="javascript">
                location.replace("Page A.htm");
</script>

Now the "back" button works properly. 

P.S.  The 'space' in my URL is just a typo.  My website name isn't really 
Page A. htm, but I work for a federal agency and we're not supposed to 
give our real names until the site is "live" and official.

==============================================
Hi,

Instead of just location, you can use location.replace("Page A2.htm")

(And avoid using spaces in your url's they should be replaced with %20 !)

/Elin

>  -----Original Message-----
> From:                  KATHLEEN.M.WHALEN@c...
> [mailto:KATHLEEN.M.WHALEN@c...] 
> Sent:          Wednesday, October 31, 2001 2:35 PM
> To:            javascript
> Subject:               [javascript] I'm stuck in a loop and I can't get 
back......
> 
> 
> 
> 
> 
> I have several pages that are designed using extensive
> JavaScript.  Due to
> accesibility issues, some of my users have Scripting turned off.
> Therefore, I have set them up to view either a page with fancy
> look (via
> scripting)or a very plain page (using no JavaScript).
> 
> I have the page set up as follows"
> Page A.htm -- home (contains link to Page A1.htm)
> Page A1.htm -- page without using javascript (if scripting is
> turned off,
> then redirected automatically to Page A2.htm)
> Page A2.htm -- page using Javascript
> 
> <BODY>
> <script language="javascript">
>         window.location="Page A2.htm";  //This will redirect
> the user to a
> page that displays the data using JavaScript.
> </script>
> <NOSCRIPT> // If JavaScript is turned off, then the content
> below is
> displayed instead.
>         page content here
> </NOSCRIPT>
> </BODY>
> 
> My problem is that when I use the Back button on the IE toolbar
> I am taken
> to Page A1.htm which contains the above script/redirect.
> Therefore, I'm
> stuck in a loop.  How can I set this up so that, if scripting
> is turned
> on, and I hit the Back button I am then taken from Page A2 to
> Page A,
> rather than Page A1.htm.
> 
> Thanks,
> Kathleen

  Return to Index