Home >Web Front-end >JS Tutorial >Solution to IE cache policy BUG_javascript skills

Solution to IE cache policy BUG_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:11:21965browse

Today is a highly productive time for finding bugs.

IE actually ignores the Cache policy when parsing innerHTML and simply loads images repeatedly. Please look at the following code:








Save it locally as an html file, then open it with IE (allow the script to run), and then use the http monitoring tool to see that IE initiated 100 requests, none cached!

There is no problem under FireFox, only one request is initiated.

Copy code The code is as follows:

Use this code to solve this problem






< ;/div>




Copy code The code is as follows:

For the official description of this bug, see:

http ://support.microsoft.com/default.aspx?scid=kb;en-us;319546

Also http://www.bazon.net/mishoo/Articles/msie/958/ Point out the background- image will cause the same problem.

ms’ official solution is like this:






http://imgcache.qq.com/qzone/item/orig/11/3179_5.gif">



If you are not afraid of trouble, this can be faster and safer:





http://imgcache.qq.com/qzone/item/orig/11/3179_5.gif" onreadystatechange="if(readyState=='complete')setTimeout( 'test()',0)">




More methods:
http://www.blogjava.net/emu/archive/2006/03/01/33082.html
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn