Closed
Bug 337810
Opened 19 years ago
Closed 19 years ago
XMLHttpRequest's synchronous mode not working
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 313646
People
(Reporter: dan.rades, Unassigned)
Details
Attachments
(1 file)
428 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3
If you have an XMLHttpRequest object, and you want to recive data synchronous it will not work.
Example:
var aVar = 'some text';
request = new XMLHttpRequest;
request.open('GET', 'http://localhost/someurl.js', false);
request.onreadystatechange = function() {
if (request.readyState == 4) {
aVar = request.responseText;
return;
}
request.send(null);
alert(aVar);//it will alert 'some text' instead of the value of request.responseText
I've tested with IE5.5/6 Opera 8.54 and works fine with them;
Reproducible: Always
Comment 1•19 years ago
|
||
testcase loading "/" in the request
Comment 2•19 years ago
|
||
*** This bug has been marked as a duplicate of 313646 ***
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Comment 3•16 years ago
|
||
confirm on FF 3.0.1
<script>
r=new XMLHttpRequest()
r.onreadystatechange=function(){if(r.readyState==4)alert(r.responseText)}
r.open('GET','1.txt',false)
r.send(null)
</script>
You need to log in
before you can comment on or make changes to this bug.
Description
•