Форум АНТИЧАТ

Форум АНТИЧАТ (https://forum.antichat.xyz/index.php)
-   PHP, PERL, MySQL, JavaScript (https://forum.antichat.xyz/forumdisplay.php?f=37)
-   -   ie6 , картинки (https://forum.antichat.xyz/showthread.php?t=130853)

imajo.ati 22.07.2009 14:06

ie6 , картинки
 
Internet Explorer 6 делает 100 запросов на одну и ту же картинку вместо 1, почему?

PHP код:

<html>
<
head>
    <
script type="text/javascript">
        function 
aaa()
        {
            var 
obj document.getElementById("imgs");
            var 
node;
            for ( var 
i=0i<100i++ )
            {
                
node document.createElement("img");
                
node.src="./RITM/img/0.gif";
                
node.alt="";
                
obj.appendChild(node);
            }
        }
        
//void
        
        
function bbb()
        {
            var 
arr document.getElementById("imgs").getElementsByTagName("img");
            var 
len arr.length;
            for ( var 
i=0i<leni++ )
            {
                
arr[i].src "./RITM/img/1.gif";
            }
        }
    </
script>
</
head>
<
body onload="aaa()">
    <
div id="imgs" onclick="bbb()"></div>
</
body>
</
html


imajo.ati 22.07.2009 14:14

он из функции bbb делает 100 запросов, другие браузеры не делают - берут из кеша.

а IE6 делает 100 запросов и на 100 запросов получает ответ 304 "not modified"

mailbrush 22.07.2009 14:20

Зачем множественно посты писать? http://forum.antichat.ru/lastpostinthread43254.html

FireFenix 22.07.2009 14:34

Попробуй использовать предзагрузку картинки

http://articles.techrepublic.com.com/5100-10878_11-5214317.html

imajo.ati 22.07.2009 15:07

предзагрузка не помогла.

лог по-прежнему забивается такими запросами:

localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/1.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -
localhost - - [22/Jul/2009:15:05:39 +0400] "GET /RITM/img/0.gif HTTP/1.1" 304 -


Время: 04:19