Get / Post 請求跨域
Post發送數據分2次,一次header,一次body,因此post會快一些緩存
XMLHttpRequest.getAllResponseHeaders()ide
XMLHttpRequest.responseTextpost
XMLHttpRequest.setRequestHeader性能
XMLHttpRequest.open()this
XMLHttpRequest.sendurl
跨域請求: 動態腳步插入orm
Multipart XHR: 切分處理ip
http://techfoolery.com/mxhr/get
imageString.split('\u0001'),
if(req.readyState===3){
window.setInterval(fn, 15)
// req.responseText.substring(lastlength, length)
}
最輕量級請求「信號燈」
var params=["step=2", 'page=3']
new Image().src=url+'?'+params.join('&')
image.onload=function(){
if(this.width==1){success}
if(this.width==2){failure, try again}
}
數據格式: 性能比較、優缺點
Verbose XML, Verbose JSON, Simple JSON, Array JSON, Custom Format(Script Insertion)
Simple XML, Verbose JSON-P, Simple JSON-P, Array JSON-P, Custom Format(XHR)
數據緩存: Cookie, Last Modified Date, Expire, Request Header, Server side configuration
Long Poll:
iframe, comet,