WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
85546
An image is not loaded and/or displayed while waiting for synchronous XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=85546
Summary
An image is not loaded and/or displayed while waiting for synchronous XMLHttp...
Teo
Reported
2012-05-03 14:56:37 PDT
Javascript doesn't do nothing before the end of the entire script! If I try to execute the function prova() from the following simple code, it prints only the variable "risultato" without showing people the image attendi.gif! In other browser, like Mozilla, it shows the image during the XmlHttpObject ... waiting, and when it receives the result it substitutes the image with the result! function GetXmlHttpObject() { var objXMLHttp=null; if (window.XMLHttpRequest) { objXMLHttp=new XMLHttpRequest(); } else if (window.ActiveXObject) { objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP"); } return objXMLHttp; } function prova() { var newdiv = document.createElement("div"); newdiv.setAttribute('id', 'extra'); var vecchio = document.getElementById('extra'); vecchio.parentNode.replaceChild(newdiv,vecchio); var newimg = document.createElement("img"); var src='images/attendi.gif?'+variab;newimg.setAttribute('src', src); newimg.setAttribute('alt', 'Attendi ...'); document.getElementById('extra').appendChild(newimg); } var xmlHttp = GetXmlHttpObject(); var i=0; var url="
http://www.mysite.com/script.php
"; if (!xmlHttp) { alert ("Browser does not support HTTP Request"); return; } xmlHttp.open("GET", url, false); xmlHttp.send(null); var risposta=xmlHttp.responseText; risposta = risposta.replace("<","<"); risposta = risposta.replace(">",">"); if (risposta=='bye') { risultato="YES"; } else { risultato="NO"; } var newdiv = document.createElement("div"); newdiv.setAttribute('id', 'extra'); var vecchio = document.getElementById('extra'); vecchio.parentNode.replaceChild(newdiv,vecchio); var newgrassetto = document.createElement("b"); newgrassetto.setAttribute("style","color:red;"); newgrassetto.innerHTML=risultato; document.getElementById("extra").appendChild(newgrassetto); }
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2012-05-03 16:28:56 PDT
Please don't use synchronous XMLHttpRequest. The Mozilla behavior where it only partially freezes the browser causes a lot of other bugs, so we do not intend to do the same.
Alexey Proskuryakov
Comment 2
2012-05-03 16:33:13 PDT
For Apple employees: this is <
rdar://problem/6653209
>.
Teo
Comment 3
2012-05-10 15:54:51 PDT
***
Bug 84032
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug