What are the status values you need to deal with when working with AJAX

The XMLHttpRequest object has few properties
 
onreadystatechange: The event handler that fires at every state change, typically a call to a JavaScript function.
 
readyState: The state of the request. The five possible values are 0 = uninitialized, 1 = loading, 2 = loaded, 3 = interactive, and 4 = complete.
 
responseText: The response from the server as a string.
 
responseXML: The response from the server as XML. This object can be parsed and examined as a DOM object.
 
status: The HTTP status code from the server (that is, 200 for OK, 404 for Not Found, and so on).
 
statusText: The text version of the HTTP status code (that is, OK or Not Found, and so on).
 
 
Here is a example code which demonstrates how these atributes can be used
 
 
function doSomething() {
 //..do something here, like adding parameter values etc...
 xmlHttp.open("GET", url);
 xmlHttp.onreadystatechange = callback;
 xmlHttp.send(null);
}
function callback() {
  if (xmlHttp.readyState == 4) {
    if (xmlHttp.status == 200) {
        //do you required work here
    }
  }
}
 
Notice the line 
xmlHttp.onreadystatechange = callback;
 
in doSomething method which is assigning a value as "callback" to the onreadystatechange attribute. 
The value is name of a method which called every time readystate of XMLHttpRequest object is changed.
 



AJAX request status, AJAX code example, AJAX code for checking status values of http request object, AJAX programming check of http request, working with request status in AJAX

226 Post Comment

«Oldest   ‹Older   201 – 226 of 226   Newer›   Newest»
Jeremy M. Womack said...

pantip
regenbox
wanelo
mojomarketplace
wordlab
woddal
gameworld
weheartit
rapichat
minimore

robert0770 said...

Thanks for sharing excellent informations. Your web-site is very cool. I’m impressed by the details that you have on this site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found simply the information I already searched all over the place and simply couldn’t come across. What a great web-site.

office.com/setup

office.com/setup

mcafee.com/activate

mcafee.com/activate

Alessia Martine said...

Office.com/setup - MS Office is one of the most used and preferred applications used globally in office and homes. It provides various interesting features to its clients to make various documents, presentations, and spreadsheets. It is effortless to use for multiple purposes and is especially beneficiary in the corporate sector. If you wish to know more about Office application and its features, then you can visit office.com/setup.


office.com/setup
office.com/setup
norton.com/setup
norton.com/setup
norton.com/setup

Alessia Martine said...

Office.com/setup - MS Office is one of the most used and preferred applications used globally in office and homes. It provides various interesting features to its clients to make various documents, presentations, and spreadsheets. It is effortless to use for multiple purposes and is especially beneficiary in the corporate sector. If you wish to know more about Office application and its features, then you can visit office.com/setup.


office.com/setup
office.com/setup
norton.com/setup
norton.com/setup
norton.com/setup

Alessia Martine said...

Office.com/setup - MS Office is one of the most used and preferred applications used globally in office and homes. It provides various interesting features to its clients to make various documents, presentations, and spreadsheets. It is effortless to use for multiple purposes and is especially beneficiary in the corporate sector. If you wish to know more about Office application and its features, then you can visit office.com/setup.


office.com/setup
office.com/setup
norton.com/setup
norton.com/setup
norton.com/setup

Emma Ludwig said...

Really great post.
Styling Tips for Woman

Riti Mallin said...

Keep all the maps and software in your Garmin device updated with Garmin Express Update. We can transfer all needful essentials to other Garmin device. Garmin software update keeps checking the latest available updates for maps and software. Get Garmin life time map update or call +1-888-309-0939 for instant help from Garmin GPS experts.

Garmin@Nuvi said...

I never used all the features of MyGarmin Express. But still I can say that this is the best app I have ever used. Garnim Nuvi comes with some refined features. Check out Garmin Nuvi or call +1-888-309-0939 for instant help from Garmin GPS experts. www.garminnuvimapupdate.com/mygarmin-express.php

alicemartin said...

Thanks for sharing this marvelous post. I m very pleased to read this article.

office.com/setup
office.com/setup
norton.com/setup
mcafee.com/activate
norton.com/setup

lola said...


Go to this website to find out about top UX trends. We'll tell you who UX writers are and what they do. We'll help you keep up with the latest changes in UX design.

Emma Ludwig said...

80scartoons
healthcabin
magnitt
usgbc
mythem

Aiden Jangra said...

Thank you so much for sharing these amazing tips. I must say you are an incredible writer, I love the way that you describe the things. Please keep sharing. Know about Hewlett packard customer service.

Roku Com Link said...

Thanks for sharing useful information with us. It really helpful to me. I always prefer to read the quality blog and this thing I found in you post. Roku comlink has excellent team of experts who can guide you for every possible Roku-related expert. You can get expert advice regarding https my roku com link, Roku express, Roku ultra, streaming stick plus, premium and premium plus, etc.

Emma Ludwig said...

Very nice and wonderful blog. Thanks for sharing.
What are the Benefits of Guest Blogging

Albert Smith said...

I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working and share more posts, you are doing great job.What a wonderful post is it, i am very happy and i appreciate your effort.Get best Dubai App Developer service you visit here for more details.

Tekniko Global said...

mobile app development company in delhi

Helen Henson said...

I love this post.
How to use Flags or Custom Flags

dorcassmith said...

Students find Nursing Assignment Writing Services as being of great assistance since they are able to seek our custom nursing research writing services and nursing homework assignment help services on time.

Bigpond Email Login said...

Bigpond email login: Email communication is an essential part of life these days. And emailing is much beyond Gmail and Microsoft Outlook. If your purpose is not just personal and you are looking for the right email hosting platform for your business then Bigpond email login is the one-stop solution to all your problems. Visit here for mail login https://getsupportpro.com/bigpond/bigpond-email-login-a-complete-guide/ .

Alessia Martine said...

How do I download Norton to another device?
In the My Norton page, click/tap Download. In the Get Started page, click Agree & Download. If you are on a mobile device, choose the subscription that you want to download and tap Next. Follow the on-screen instructions.
If you are interested and use this product, You can go here my website
norton.com/setup

Garmin Express Update said...

I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty blog with me. I am appreciating it very much! Looking forward to another great blog. Know about Garmin Express Update.

Jacob Grayson said...

www.canon.com/ijsetup
www.norton.com/setup
solutions.brother.com/windows
Malwarebytes unable to connect to service
virus alert from Microsoft this computer is blocked
avast virus definitions won't update

Jacob Grayson said...

canon.com/ijsetup
epson connect printer setup utility
www.avg.com/retail
how to install Norton antivirus on Windows 10
how do i reinstall norton 360 without disc
support.brother.com/windows
Canon printer drivers for chromebook

QuickBooks Support said...

Your blog is great. I read a lot of interesting things from it. Thank you very much for sharing. Hope you will update more news in the future. For instant support related to QuickBooks Error Code 179 please contact our technical expert for help related to QuickBooks.

Devin Wilson said...

Hello, I'm Devin Wilson. I am working as a freelancer and expert to resolve an issue on Email. For instant support related to Quickbooks Payroll Problems then please visit https://www.errorcodeexpert.com/five-ways-to-introduce-quickbooks-payroll-problems/ for instant help related to Email.

Mtech Support said...

If you are using HP Printer and your HP Printer not printing then follow us and get step-wise solution to fix this problem or contact with help number to get support quickly by expert technicians.

«Oldest ‹Older   201 – 226 of 226   Newer› Newest»

Post a Comment

Search Web......