prevent iframe content reload on hide in firefox
-
19-09-2019 - |
Question
In my webapplication I hide an iframe using jquery hide() function. Surprisingly firefox reload the content of iframe when the iframe is hidden. Is this a known problem? Is there a workaround? I also tried to hide the iframe setting css style display to 'none'. Same result.
The script work as expected in opera.
I'm using firefox 3.5.1
Solution
Don't know about that bug, but one possible solution is to set height and width to 0px instead, maybe?
OTHER TIPS
Some say the solution might be in providing a different id or name attribute for each IFRAME = but it did not work in my Case (FF 3.6+)
Another possible solution is to make sure the iframe's content is not taken from the browsers cache.
this can be done by concatenating a randomizing string to the the iframe's source URL, making sure the content will never come from the cache.
all in all, its a bug that should be fixed by the Mozilla team!..