473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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 6283
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: David | last post by:
Hello I'm testing the XMLHttpRequest object in Firefox and IE. The code below works well in IE and Firefox. It shows "1" when the string is a number and "0" when not. The page aspxTest.aspx only...
3
by: sameergn | last post by:
Hi, Can anyone confirm is AJAX request can be sent over HTTPS if the containing page is loaded via HTTPS? or is it true that all AJAX interaction take place via HTTP? (Since the name of the...
4
by: keyofdminor | last post by:
Folks, Short version: Has anyone tried a synchronous call ("SJAX") to a server with the Prototype library? I'm curious if there is a bug in the library (possible) or if I am making mistake...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
5
by: HugeBob | last post by:
Hi All, I've got a question about Asynchronous vs Synchronous mode with the XMLHttpRequest object. What are the ramifications of using one mode vs the other? If the script uses Asynchronous...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
1
nmm32
by: nmm32 | last post by:
I am trying to use Ajax with JSP to populate a 2nd drop down list based on the chosen option of the first one. I am getting the error "Object Expected" on the line 13-14 of the HTML: <script...
10
dmjpro
by: dmjpro | last post by:
function synchronous_ajax(){ var ajax = null; if(typeof ActiveXObject!='undefined') ajax = new ActiveXObject("Microsoft.XMLHTTP"); else if(typeof XMLHttpRequest!='undefined') ajax = new...
3
by: sarika | last post by:
Hi all I m making a website in which i have used ajax technology . When i make a page request throght ajax it works fine in IE but giving problems in Mozilla .In mozila i m getting 403 status code...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.