469,647 Members | 1,769 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Synchronous ajax request in mozilla

Hi all!
I am trying to access a page through Synchronous Ajax request in
mozilla firefox
I could not get the response ..
After the requset is sent , "onreadystatechange" function is not being
called .. (it does mean that State is not changing ..)

<script>
var req = new XMLHttpRequest();
req.open('GET', '_temp_delete.html', false);

req.send(null);
req.onreadystatechange = function(){
if(req.readyState==4)
{
if(req.status == 200)
alert(req.responseText);
}
};

</script>

But i can view the response in mozilla "firebug console"

What is the problem here ? Any code changes to be made ??
Please help me out ..

Nov 21 '06 #1
2 6170
Prasad wrote:
Hi all!
I am trying to access a page through Synchronous Ajax request in
mozilla firefox
I could not get the response ..
After the requset is sent , "onreadystatechange" function is not being
called .. (it does mean that State is not changing ..)

<script>
var req = new XMLHttpRequest();
req.open('GET', '_temp_delete.html', false);

req.send(null);
req.onreadystatechange = function(){
if(req.readyState==4)
{
if(req.status == 200)
alert(req.responseText);
}
};

</script>

But i can view the response in mozilla "firebug console"

What is the problem here ? Any code changes to be made ??
Please help me out ..
As far as I know, you don't need the onreadystatechange
when you send synchronous.

req.send(null);

will block until the respons is received, and the you just go:

alert(req.responseText);

--
Dag.
Nov 21 '06 #2

Dag Sunde wrote:
Prasad wrote:
Hi all!
I am trying to access a page through Synchronous Ajax request in
mozilla firefox
I could not get the response ..
After the requset is sent , "onreadystatechange" function is not being
called .. (it does mean that State is not changing ..)

<script>
var req = new XMLHttpRequest();
req.open('GET', '_temp_delete.html', false);

req.send(null);
req.onreadystatechange = function(){
if(req.readyState==4)
{
if(req.status == 200)
alert(req.responseText);
}
};

</script>

But i can view the response in mozilla "firebug console"

What is the problem here ? Any code changes to be made ??
Please help me out ..

As far as I know, you don't need the onreadystatechange
when you send synchronous.

req.send(null);

will block until the respons is received, and the you just go:

alert(req.responseText);
Thanx it worked out for me
--
Dag.
Nov 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by sameergn | last post: by
4 posts views Thread by keyofdminor | last post: by
1 post views Thread by geevaa | last post: by
3 posts views Thread by sarika | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.