Added a time marker for tracks
[moodle.git] / mod / scorm / request.js
CommitLineData
2a0407b7 1function NewHttpReq() {
2 var httpReq = false;
3 if (typeof XMLHttpRequest!='undefined') {
4 httpReq = new XMLHttpRequest();
5 } else {
6 try {
5e5b6b7f 7 httpReq = new ActiveXObject("Msxml2.XMLHTTP.4.0");
2a0407b7 8 } catch (e) {
5e5b6b7f 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 }
2a0407b7 19 }
20 return httpReq;
21}
22
4928a2f3 23function DoRequest(httpReq,url,param) {
2a0407b7 24 //
25 // httpReq.open (Method("get","post"), URL(string), Asyncronous(true,false))
26 //
1daed920 27 httpReq.open("get", url+'?'+param,false);
28 //httpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
29 httpReq.send(null);
30 if (httpReq.status == 200) {
31 return httpReq.responseText;
32 } else {
33 return httpReq.status;
34 }
a5463b34 35}
36
37function popupwin(content) {
38 op = window.open();
39 op.document.open('text/plain');
40 op.document.write(content);
41 op.document.close();
42}