   [web] Back, Forward, and changing the DOM
  Heya,One bit of trouble I'm having is that the Back and Forward buttons on most browser seem to work with cached versions of the page. There is no attempt to reload the page from the server.So say I have an array of records that I want to display in a table, and my script has some for loop which it uses to print out all of the HTML for each table row (PHP, for instance).Now, say I have an "Add New Record" button of sorts, which pops up a JQuery dialog with a form in it, and when the user submits the form, Ajax is used to add the record to the database. Then, the table is updated with a new row with the new record's information in it using &#106avascript.Ok, so after doing that, if the user navigates away from the page, and then comes back to it using the Back button, the new row won't be there anymore. That's because the page was cached when it was loaded, before the user used the slick JQuery/Ajax stuff to add the row.So one solution I tried was to, in the script the generates the HTML in the first place, have it construct a &#106avascript object literal with all of the server data in it. Then, on page load, I would run a &#106avascript function that would go through the object and add all of the necessary rows. This works great actually. And then, when the user wants to add a record to the database, they hit the appropriate button, the JQuery dialog pops up, they fill out the form, hit submit, an Ajax request is initiated, and the response comes back from the server with all the necessary data. At this point, not only do I use &#106avascript to manipulate the DOM in order to add a new row to the table, I also push the new data onto this &#106avascript object I created.The thinking here is that maybe the browser retains the &#106avascript state when the user navigates away from the page, so if they come back to it using the Back button, that object is already constructed -- including the new data that the user added -- thus solving my problem.It doesn't seem to work this way, though. So now it seems that the only way to do this is to do an Ajax request on page load that gets all the data, and then builds the table once it receives a response. I can do this, but it seems wasteful. I mean, why have a controller if my view is just going to start off like a blank slate and request all of the data it needs with Ajax?   