First step for SCORM2004, new communication subsystem
[moodle.git] / mod / scorm / request.js
1 function NewHttpReq() {
2     var httpReq = false;
3     if (typeof XMLHttpRequest!='undefined') {
4         httpReq = new XMLHttpRequest();
5     } else {
6         try {
7             httpReq = new ActiveXObject("Msxml2.XMLHTTP.4.0");
8         } catch (e) {
9             try {
10                 httpReq = new ActiveXObject("Msxml2.XMLHTTP");
11             } catch (ee) {
12                 try {
13                     httpReq = new ActiveXObject("Microsoft.XMLHTTP");
14                 } catch (eee) {
15                     httpReq = false;
16                 }
17             }
18         }
19     }
20     return httpReq;
21 }
23 function DoRequest(httpReq,url) {
24     //
25     // httpReq.open (Method("get","post"), URL(string), Asyncronous(true,false))
26     //
27     httpReq.open("get", url,false);
28     httpReq.send(null);
29     return httpReq.responseText;
30 }