Changeset 16559
- Timestamp:
- 06/01/13 16:03:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16557 r16559 105 105 function getXML() 106 106 { 107 if (window.XMLHttpRequest) 108 {// code for IE7+, Firefox, Chrome, Opera, Safari 109 xmlhttp.push(new XMLHttpRequest()); 110 } 111 else 112 {// code for IE6, IE5 113 alert("new other request created"); 114 xmlhttp.push(new ActiveXObject("Microsoft.XMLHTTP")); 115 } 116 107 xmlhttp.push(new XMLHttpRequest()); 117 108 index = xmlhttp.length - 1; 118 $('#data').append('XML request is in the array! '); 119 //document.getElementById('data').innerHTML="XML request is in the array! "; 120 121 } 109 } 122 110 123 111 function getXMLData() 124 112 { 125 113 getXML(); 126 xmlhttp[index].onreadystatechange=xmlStateChange(); 127 $('#data').append('XML data were taken'); 128 //document.getElementById('data').innerHTML="XML data were taken! "; 129 130 xmlhttp[index].open("GET","http://www.fact-project.org/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true); 114 xmlhttp[index].onload=xmlStateChange(); 115 116 xmlhttp[index].open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true); 131 117 xmlhttp[index].send(); 132 118 } … … 134 120 function xmlStateChange() 135 121 { 136 $('#data').append('XML state is activated!'); 137 alert(index+" "+xmlhttp[index].readyState+" "+xmlhttp[index].status + " " + xmlhttp[index].statusText); 138 if (xmlhttp[0].readyState==4 && xmlhttp[0].status==200) 122 alert(index+" "+xmlhttp[index].readyState+" "+xmlhttp[index].status + " " + xmlhttp[index].statusText); 123 if (xmlhttp[index].readyState==4 && xmlhttp[index].status==200) 139 124 { 140 125 //sourceData[index]= new Array(); //--> remove this if you use sourceData[[]] 141 126 line=xmlhttp[index].responseText.split('\n'); 142 $('#data').append('XML value has changed!');143 //document.getElementById('data').innerHTML="XML value has changed!";144 document.getElementById('data').innerHTML=xmlhttp[index].responseText;145 146 127 for(row=0;row<line.length;row++) 147 128 { 148 $('#data').append('XML data was looped!');149 129 rows=line[row].split(','); 150 130 sourceData[index].push(rows[4]); 151 131 } 152 document.getElementById('data').innerHTML=line;153 132 } 154 else155 $('#data').append('xmlhttp status undefined');156 157 133 } 158 134 … … 193 169 year =this.selection.print("%Y").join("\n"); 194 170 //document.getElementById('data').innerHTML="Calendar selected! "; 195 $('#data').append('XML data were taken'); 196 171 197 172 alert ("event here"); 198 testData(); 199 //displayData(); 200 /*for (i=0; i<source.length; i++) 201 { 202 getXMLData(); 203 //display source data here sourceData[i] 204 //document.getElementById('data').innerHTML=sourceData[i]; 205 } */ 206 207 }); 173 //testData(); 174 for (i=0; i<source.length; i++) 175 { 176 getXMLData(); 177 document.getElementById('data').innerHTML=sourceData[i]; 178 } 179 }); 208 180 209 181
Note:
See TracChangeset
for help on using the changeset viewer.