I have a bit of javascript magic going on to create and hide divs on the fly as the user interacts with the page. Each div contains a view of some part of my application and each model instance in these views has an owner. If the person browsing the page is NOT the owner, they just see the data. However, if the user is the owner of the data, they get an edit view.

It might be possible to stash off the state of all the divs and re-render the page exactly as it was when the user submits changes, but I'd rather just have some quick-and-easy way to have the transaction be something along the lines of: user hits submit button, server processes changes and sends back confirmation, minor change on screen flashes the notification of the completion of the transaction.

Anyone have a pointer to a working example? The threshhold for implementation is going to be whether it is easier to do what I'm asking about here or just bite the bullet and carry the div state through the transaction.