MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / scorm / request.js
blob3511ae4a19722d0b53332dd9b17d6ca0d67feba8
1 <!--
2 function NewHttpReq() {
3     var httpReq = false;
4     if (typeof XMLHttpRequest != 'undefined') {
5         httpReq = new XMLHttpRequest();
6     } else {
7         try {
8             httpReq = new ActiveXObject("Msxml2.XMLHTTP.4.0");
9         } catch (e) {
10             try {
11                 httpReq = new ActiveXObject("Msxml2.XMLHTTP");
12             } catch (ee) {
13                 try {
14                     httpReq = new ActiveXObject("Microsoft.XMLHTTP");
15                 } catch (eee) {
16                     httpReq = false;
17                 }
18             }
19         }
20     }
21     return httpReq;
24 function DoRequest(httpReq,url,param) {
26     // httpReq.open (Method("get","post"), URL(string), Asyncronous(true,false))
27     //popupwin(url+"\n"+param);
28     httpReq.open("POST", url,false);
29     httpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
30     httpReq.send(param);
31     if (httpReq.status == 200) {
32         //popupwin(url+"\n"+param+"\n"+httpReq.responseText);
33         return httpReq.responseText;
34     } else {
35         return httpReq.status;
36     }
39 function popupwin(content) {
40     var op = window.open();
41     op.document.open('text/plain');
42     op.document.write(content);
43     op.document.close();
45 //-->