MDL-11517 reserved word MOD used in table alias in questions backup code
[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 //-->