AJAX异步传输用到哪些对象?具体实例。
答案:1 悬赏:20 手机版
解决时间 2021-05-19 15:12
- 提问者网友:浮克旳回音
- 2021-05-18 17:25
AJAX异步传输用到哪些对象?具体实例。
最佳答案
- 五星知识达人网友:患得患失的劫
- 2021-05-18 18:38
function ajax(){
this.method;
this.url;
this.responsetype;
this.content;
var http_request = false;
this.getExecObj = function(reValue){
if(window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType(text/xml);
}
}
else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject(Msxml2.XMLHTTP);
} catch (e) {
try {
http_request = new ActiveXObject(Microsoft.XMLHTTP);
} catch (e) {}
}
}
if (!http_request) {
//window.alert(创建XMLHttpRequest对象实例失败.);
return false;
}if(this.method.toLowerCase()==get) {
http_request.open(this.method, this.url, true);
}
else if(this.method.toLowerCase()==post) {
http_request.open(this.method, this.url, true);
http_request.setRequestHeader(Content-Type,application/x-www-form-urlencoded);
}
else {
//......余下全文>>
this.method;
this.url;
this.responsetype;
this.content;
var http_request = false;
this.getExecObj = function(reValue){
if(window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType(text/xml);
}
}
else if (window.ActiveXObject) {
try {
http_request = new ActiveXObject(Msxml2.XMLHTTP);
} catch (e) {
try {
http_request = new ActiveXObject(Microsoft.XMLHTTP);
} catch (e) {}
}
}
if (!http_request) {
//window.alert(创建XMLHttpRequest对象实例失败.);
return false;
}if(this.method.toLowerCase()==get) {
http_request.open(this.method, this.url, true);
}
else if(this.method.toLowerCase()==post) {
http_request.open(this.method, this.url, true);
http_request.setRequestHeader(Content-Type,application/x-www-form-urlencoded);
}
else {
//......余下全文>>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯