IE form input data disappear after browser refresh - html

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 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

Related

Depricated rel="prerender" in Chrome

I want to use the resource hint "prerender" (W3C) to speed up a website, but prerender is depricated in Chrome since v58. I read that NoState-Prefetch should be used instead (Google Dev), but I don't find anything on how to use it.
Does anybody know how I can prerender a site with the current version of Chrome or how to use "NoState-Prefetch"?
I'm grateful for every suggestion. Many thanks in advance.
Prerender is not deprecated, in fact it's part of the w3 standards. Though the standards are clear in that the user agent SHOULD fetch, however later it describes that it May preprocess, and adds a point later that the user agent might decide not to do anything.
Chrome initiated the prerender resource hint, previously it meant that the whole page should be pre-rendered in a hidden renderer process, but currently chrome does NoState-Prefetch which is less powerful than a full render but should still save time - in case the browser actually do it.
You can take a look at the following document to dig deeper, into why chrome changed the implementation of prerender, and when/what does No-State Prefetch do exactly.
To check that the browser did prerender locally:
go to chrome://net-export/ ( this will export a log of all the network activities happening from all chrome windows, apps, and extensions)
go to the website where you want to check prerendering, give it some time to idle and do the prerendering
save the json file from the net export page, and load it into https://netlog-viewer.appspot.com/
After its loaded, check the Prerender page found in the menu in the left side

Why do HTML Entities get garbled in View Source?

I've seen this behavior across several different browsers over the years (Chrome, Firefox, and Opera, at least), but most recently it happens only in Opera and Chrome - I think Firefox fixed it at some point. If I have a page which pushes a fairly sizeable chunk of data (several thousand lines of HTML) to the browser, if I use any HTML Entities in the data, they come through malformed when you view the source code.
For example, I put a "lower right pencil" entity ( ✎ - or ✎) throughout the contents of a page in order to label "Edit" links. However, when I load the same page in any browser and click "View Source", I see a random code that often does not match what is actually hard coded into the page HTML. Some examples include:
&x#x2#x270E;, &#x#x270E;, &#x270#x270E;
Examining a Fiddler capture of the actual source code being sent to the browser shows that the browser indeed receives the CORRECT codes. Something seems to go awry as soon as the browser tries to display it in a view-source tab.
It happens with other codes too, becomes &nbnbsp; or &nnbsp; etc. Mysteriously, these randomize with each refresh. Once in a while they come through correct, though most of the time they get garbled. The codes appear to render correctly on the front-end, is this just a bug in every major browser, or should I be concerned about data loss when pushing somewhat large data sets over HTTP?
Past Tests
I ran two tests to confirm this:
(1) Spammed a single character into a valid HTML5 page's contents hosted on a public facing AWS LAMP server. Viewed the contents in Opera and viewed source. Most were okay, but about half way down it starts to trip up, and continues sporadically throughout:
&#x27#x270E;
(2) Spammed a single character into a valid HTML5 page's contents hosted on an intranet Windows server and served over a NetExtender VPN. Same result as the first test.
&#x270#x270E;✎
Steps to Reproduce:
I have tested this on many different systems (Linux - like Ubuntu, Windows 7 and Windows 10 so far) on several different networks. However, I would appreciate if others could confirm this.
Create a valid HTML page and paste a single HTML Entity (either decimal or hexidecimal representation) between the body tags.
Copy and paste the character to fill up several hundred lines of content (less may be required, but more will be most likely to produce the same issue). For example: ... etc.
Save the page on your web server.
Load the page in a new Opera window.
Right click anywhere in the page and click "Page source"
Copy the source code and either manually examine it or just paste it into the W3 Validator at https://validator.w3.org - it will help to point out the incorrectly formatted HTML Entities.
Opera 49.0 Illustration
See below how the Code Inspector shows the correct HTML Entity code. However, when you view Page Source for the same section, the code gets malformed.

Website Messed Up Only If Accessed In Past

So my website: ropinranch.com
looks FINE on any browser (so far) if you haven't accessed the page in the past. But for any of my previous users, it looks messed up when they load it.
We've all cleared all of our cookies, and emptied our cache. I even edited a new image on the page to see if that would change and it DID.
I cannot think any other way the page would be keeping memory of it.
One of my testers said that if they had the page bookmarked in the past of it working fine, that when clicking on the bookmark it loads fine still -- but typing in a URL fails.
Any other ideas on what I'm missing here?
Update: I realized what happened -- but I'm unsure how to fix.
https://ropinranch.com WORKS
but
www.ropinranch.com does not. I know theres a setting in my c-pannel to change this but I don't know what it's called
Try ctrl+F5 to reload the page without caching.
This helped me temporarily:
By Varun: If you are just testing, could you try passing a timestamp or random number in the URL ( manually , just for testing ) and check. Eg : http://ropinranch.com?f=141414542343 (each time with a diff number )
But What I did was I had to go through the server and reroute all traffic to my SSL site rather than things of www. or http://

Using HTML's Application Cache without caching the current page itself?

My page references a lot of PDF's. If the user loses connection to the Internet or their network, which unfortunately seems to happen quite a bit for our users in the middle of nowhere, I would still like them to be able to access the PDF's.
Using the Application Cache mostly works, except that it also caches the current page itself, and I can't figure out how to get it not to do that. The page itself changes frequently so I don't want it to cache. I know I can find out if it has changed, but that just means I have to refresh the page after they're already using it, which is not ideal.
So is there any way to NOT have the current page cache, but have everything else in my manifest file be cached?
I tried several different things without success. I added an iframe, which did seem to cache the PDFs, but when I went offline my current page did not access them from the cache (because the browser didn't know to grab it from the cache I would guess, I just know it didn't work). I also tried adding the current page to the NETWORK section of the manifest, so it wouldn't be cached, but it didn't work (it was still cached).
Am I missing something? Is there a better alternative for what I want?
It works without the "download" attribute on the anchor tag.
If anyone else has the same problem, the iframe solution does work (where you add a hidden iframe to the page, and the iframe is pointed to a page that has a manifest file for everything you need). It just doesn't work if you have a download attribute on your anchor tag.
That's about 3 hours I'll never get back...

Microsoft Windows and IE not handling images (favicons too)

I've read the SO posts regarding this and can not find a solution.
I've tried changing the link in the HTML to another location. I've tried clearing all the browser data. But, it still pulls a previous favicon.ico.
Does anyone know where it is getting this old favicon.ico? I should be able to delete it manually at a minimum.
This site process does not work.
http://www.phpjunkyard.com/tutorials/force-favicon-refresh.php
Actually answer might be here:
How to clear IE's favicon cache?
This is wrong too...clearing the browsing history and cache..does nothing to the favicon.ico file
O.K...there was a check box you have to de-select to keep it from saving favorites...this was not intuitive b.c. you have to select all the rest.
From there I changed the file name and link to in the HTML.
Then I waited about a day
Then it changed....I.E has some sort of timer..can anyone quantify this delay for it to pick up changes?
I've recently noticed that Windows 7 does not update images, that is if I save and image over and exiting image...windows will still display the old image until I click on it. Probably related in some way to Microsoft's philosophy on updating images