moodle/mod/scorm/request.js
bobopinna 1daed920e4 Removed field datadir form scorm table
Fixed a validation problem.
2005-04-15 14:34:48 +00:00

35 lines
873 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("get", url+'?'+param,false);
//httpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
httpReq.send(null);
if (httpReq.status == 200) {
return httpReq.responseText;
} else {
return httpReq.status;
}
}