473,785 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 , "onreadystatech ange" function is not being
called .. (it does mean that State is not changing ..)

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

req.send(null);
req.onreadystat echange = function(){
if(req.readySta te==4)
{
if(req.status == 200)
alert(req.respo nseText);
}
};

</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 6300
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 , "onreadystatech ange" function is not being
called .. (it does mean that State is not changing ..)

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

req.send(null);
req.onreadystat echange = function(){
if(req.readySta te==4)
{
if(req.status == 200)
alert(req.respo nseText);
}
};

</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 onreadystatecha nge
when you send synchronous.

req.send(null);

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

alert(req.respo nseText);

--
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 , "onreadystatech ange" function is not being
called .. (it does mean that State is not changing ..)

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

req.send(null);
req.onreadystat echange = function(){
if(req.readySta te==4)
{
if(req.status == 200)
alert(req.respo nseText);
}
};

</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 onreadystatecha nge
when you send synchronous.

req.send(null);

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

alert(req.respo nseText);
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
17996
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 write "0" or "1" with a "response.write" method. The problem that I have is when I try this example with Synchronous mode. If I change the function sendNum with: xmlhttp.open("GET",url,false);
3
91344
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 class is XMLHttpRequest and not XMLHttpsRequest) Thanks, Sameer
4
10552
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 (probable). Longer version:
1
4033
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 technology is implemented on more sites now than ever. Compatibility is no longer an issue (IE, Mozilla and Opera all support it), and the benefits to using it are amazing. There are too many PHP programmers avoiding any
5
15510
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 mode, it sounds as if a thread retrieves the data from the supplied URL and the JS function that called the open() and send() methods continues on. Where as using Synchronous mode the method that called open() and send() waits until the data from...
6
8635
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 tried, including my conclusions/assumptions (which i'll happily be corrected on if it solves my problem!): The requirement not to use a proxy means I can't use the synchronous
1
8373
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 language="javascript"> // Global Variable for XmlHttp Request Object var xmlhttp; var yearDDL; function handleOnChangepType(ddl) {
10
2322
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 XMLHttpRequest(); else{alert('Ajax is not support!!!!!');return;} alert('Yahoo: ' + ajax); ajax.open("GET","http://www.google.co.in/",false); ajax.send(null); alert(ajax.status);
3
3512
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 with"Error 403 "Access Denied/Forbidden"" . Though same script is working fine in mozilla when run through other server. Please reply asap.
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.