IE form input data disappear after browser refresh
I'm trying to achieve sticky forms without PHP. My setup is AJAX like javascript. The back/forward work fine on both IE and FF, but refresh only works on FF, not IE. Doesn't matter what cache options I use, I've even set IE's temporary files option to never check for updates, and the input value is gone after page refresh(the refresh button or F5)
I've read many posts where people have the opposite problem, and do not want form data to persist across page refresh, and never read from 开发者_StackOverflow中文版browser cache, but I do.
Any help is appreciated, thanks!
ps. posts like HTML - input value kept after Refresh are exactly the opposite of my problems
IE/Chrome/Safari/Opera/etc has the expected behavior.
I consider it a bug that FF doesn't actually refresh the fields when you click refresh.
After all, the purpose of the refresh is to dump what you have and reload from the server. For Firefox to then merge any changed information / fields back into the form is unexpected behavior and, IMHO, bad by design.
Also note that this one issue has been fought over at Mozilla for 10 years. It is a source of MANY duplicate bug reports, is considered by many to be a critical failure, and is quite frankly a complete PITA. I don't know how many times I've had to explain to non-techies why the Firefox reload button doesn't, well, reload the page.
Lately I've taken to just telling them that the Firefox reload button is broken and that they have to either hold down the shift key which clicking refresh or use a different browser. Thankfully we have choices.
--- Update due to a comment stating confusion as to what F5 and Ctrl-F5 are --
All browsers (except Firefox) treat F5 as "reload". Which means reload the page either from cache or from the server if cache is disabled. Firefox does do the reload, but it also repopulates any boxes with stuff you've typed in... Provided those fields still exist. IMHO, this is bad behavior as a page may have changed and you end up in a very invalid state with some things filled in and others not.
To be clear, the cache does not contain what you typed in the page; cache only contains what the server sent you. So Firefox itself takes this extra step of trying to merge previously typed in and unsubmitted data. Again, NONE of the other browsers do this and it is a source of much confusion.
All browsers (including Firefox) treat Ctrl F5 as "reload from server". This ignores any files you've cached (images, css, javascript, etc) and pulls it brand new from the server. Thankfully, Firefox does not merge unsubmitted data back into the page when you do a Ctrl-F5.
Even though I agree with Chris, would this be of any help?
http://snipplr.com/view/799/get-url-variables/
It would allow you to store things in the URL (like phps GET) and access them with javascript
精彩评论