It's a browser and caching issue, web.py has nothing to do with that.
Here some hints unsing onbeforeunload:

"Just having an unbeforeunload event handler -- regardless of whether
or not it actually does anything, regardless of whether or not you
spawn a dialog box or not, even if the entire function declaration
consists entirely of just { } -- just defining an event handler will
prevent the page from being cached -- ever.

    As a matter of fact, even if you allow page caching, the page will
be not be cached. Having an onbeforeunload event means the page will
be re-built every single time it is accessed. Javascripts will re-run,
server-side scripts will be re-run, the page will be built as if the
user was hitting it for the very first time, even if the user got to
the page just by hitting the back or forward button."
-- http://ajaxian.com/archives/newsvine-live-evergreen-is-forever

You still might have issues with Opera which has a cache of the DOM
itself, and that's more agressive ;-)

Anyway, by clicking the backbutton, the user expects to go to the
previous step. There is maybe something wrong with your application
flow.

Cheers,

-- Yoan

On Wed, Mar 5, 2008 at 7:39 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>  I apologize in advance for this question, which is not exactly related
>  to webpy but about how browsers work, I guess...
>
>  I wrote a simple shopping cart, with which I can add and remove
>  products or reset the order.
>  Every time I perform one of these actions, the script shows the
>  current state of the order in a table.
>  The contents of the order are stored in a session variable, which is
>  an instance of the cart.
>
>  The problem is that every time I hit the back button, it shows the
>  previous state of the order, not the current.
>  Is there any way to avoid this? I mean, is there any way that, no
>  matter what I do, the table shows always the current state of the
>  order and not a previous snapshot?
>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to