










XMLHttpRequest is a key part of Ajax. The other part is javascript, so XMLHttpRequest is basically half of Ajax.
You can use it to get info from the server:
function handler() {
if(this.readyState == 4 && this.status == 200) {
// so far so good
if(this.responseXML != null && this.responseXML.getElementById('test').firstChild.data)
// success!
test(this.responseXML.getElementById('test').firstChild.data);
else
test(null);
} else if (this.readyState == 4 && this.status != 200) {
// fetched the wrong page or network error...
test(null);
}
}
var client = new XMLHttpRequest();
client.onreadystatechange = handler;
client.open("GET", "test.xml");
client.send();You can log a message from the server:
function log(message) {
var client = new XMLHttpRequest();
client.open("POST", "/log");
client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
client.send(message);
}
Also, you can check the status of a document on the server:function fetchStatus(address) {
var client = new XMLHttpRequest();
client.onreadystatechange = function() {
// in case of network errors this might not give reliable results
if(this.readyState == 4)
returnStatus(this.status);
}
client.open("HEAD", address);
client.send();
}
Where did XMLHttpRequest come from?
Microsoft gave us XMLHttpRequest in 2000, it was originally a server side API call for Outlook Web Access. Over time, web browsers have implemented XMLHttpRequest. If you are using a modern browser (IE 7 and up) then your page's javascript can use XMLHttpRequest. If you are sticking to your guns and not upgrading your browser then your page needs to invoke. XMLHttpRequest via an ActiveX Object.
In order to stomp out platform-specific code, the World Wide Web Consortium developed a working draft of XMLHttpRequest object's API.
true religion jeans sale
ReplyDeletecheap replica watches
lululemon pants
reebok shoes
toms outlet store
michael kors sale
coach outlet
ralph lauren outlet
tiffany jewelry
polo ralph lauren
coach outlet store
tiffany outlet
reebok trainers
tiffany and co
ferragamo shoes
louis vuitton sunglasses for women
hollister clothing
ray ban sunglasses
ray-ban sunglasses
cheap oakley sunglasses
ralph lauren outlet
longchamp pliage
ray-ban sunglasses
beats headphones
air jordan shoes
polo ralph lauren
fitflops sale
tiffany outlet
michael kors wholesale
hollister uk
air max 90
tiffany jewelry
burberry outlet
true religion jeans outlet
timberland boots
20160415caihuali
20161021 junda
ReplyDeleteoakley sunglasses
coach outlet canada
uggs
coach outlet
ferragamo shoes
air jordan shoes
canada goose outlet
swarovski crystal
coach outlet
uggs clearance
JIANBIN1228
ReplyDeleteray ban sunglasses
nike outlet
mulberry outlet
beats by dr dre
true religion outlet
ugg outlet
michael kors handbags
ugg boots outlet
dior sunglasses
louis vuitton bags
louis vuitton handbags
ReplyDeleteray-ban sunglasses
oakley sunglasses wholesale
toms shoes
nike huarache
nobis jackets
nike free running
chrome hearts outlet
nba jerseys wholesale
cheap jordans
chanyuan2017.01.16
20170324 junda
ReplyDeletecoach outlet online
christian louboutin outlet
cheap nhl jerseys
tory burch outlet
coach outlet canada
fitflops
michael kors outlet
cartier outlet
true religion jeans
nba jerseys