moodle/mod/scorm/request.js

30 lines
699 B
JavaScript

function NewHttpReq() {
var httpReq = false;
if (typeof XMLHttpRequest!='undefined') {
httpReq = new XMLHttpRequest();
} else {
try {
httpReq = new ActiveXObject("Msxml2.XMLHTTP.4.0");
} catch (e) {
try {
httpReq = new ActiveXObject("Msxml2.XMLHTTP");
} catch (ee) {
try {
httpReq = new ActiveXObject("Microsoft.XMLHTTP");
} catch (eee) {
httpReq = false;
}
}
}
}
return httpReq;
}
function DoRequest(httpReq,url,param) {
//
// httpReq.open (Method("get","post"), URL(string), Asyncronous(true,false))
//
httpReq.open("post", url,false);
httpReq.send(param);
return httpReq.responseText;
}