Changeset 16496
- Timestamp:
- 05/30/13 15:33:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16494 r16496 97 97 var xmlhttp = new Array(); 98 98 var source = ['Mrk 421','Mrk 501']; 99 var sourceData = [];99 //var sourceData; 100 100 var day; 101 101 var year; 102 102 var month; 103 103 function getXML() 104 { 105 if (window.XMLHttpRequest) 106 {// code for IE7+, Firefox, Chrome, Opera, Safari 107 xmlhttp.push(new XMLHttpRequest()); 108 } 109 else 110 {// code for IE6, IE5 111 xmlhttp.push(new ActiveXObject("Microsoft.XMLHTTP")); 112 } 113 114 index = xmlhttp.length - 1; 115 } 116 117 function getXMLData() 118 { 119 getXML(); 120 xmlhttp[index].onreadystatechange=function() 121 { 122 if (xmlhttp[index].readyState==4 && xmlhttp.status==200) 104 123 { 105 if (window.XMLHttpRequest) 106 {// code for IE7+, Firefox, Chrome, Opera, Safari 107 xmlhttp.push(new XMLHttpRequest()); 108 } 109 else 110 {// code for IE6, IE5 111 xmlhttp.push(new ActiveXObject("Microsoft.XMLHTTP")); 112 } 124 var sourceData[index]= new Array(); //--> remove this if you use sourceData[[]] 125 line=xmlhttp[index].responseText.split('\n'); 126 for(row=0;row<line.length;row++) 127 { 128 rows=line[row].split(','); 129 sourceData[index].push(rows[4]); 130 } 131 } 132 } 133 xmlhttp[index].open("GET","http://www.fact-project.org/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true); 134 xmlhttp[index].send(); 135 } 113 136 114 index = xmlhttp.length - 1; 115 } 116 117 function getXMLData() 118 { 119 getXML(); 120 xmlhttp[index].onreadystatechange=function() 121 { 122 if (xmlhttp[index].readyState==4 && xmlhttp.status==200) 123 { 124 sourceData[index]= new Array(); //--> remove this if you use sourceData[[]] 125 line=xmlhttp[index].responseText.split('\n'); 126 for(row=0;row<line.length;row++) 127 { 128 rows=line[row].split(','); 129 sourceData[index].push(rows[4]); 130 } 131 } 132 } 133 xmlhttp[index].open("GET","http://www.fact-project.org/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true); 134 135 xmlhttp[index].send(); 136 } 137 138 function displayData() //--> you can use the content of this function in the event listener 139 { 140 for (i=0; i<source.length; i++) 141 { 142 getXMLData(); 143 //display source data here sourceData[i] 144 document.getElementById('data').innerHTML=sourceData; 145 } 146 } 137 function displayData() //--> you can use the content of this function in the event listener 138 { 139 for (i=0; i<source.length; i++) 140 { 141 getXMLData(); 142 //display source data here sourceData[i] 143 document.getElementById('data').innerHTML=sourceData[i]; 144 } 145 } 147 146 CAL.addEventListener("onSelect", function(){ 148 147 day =this.selection.print("%d").join("\n");
Note:
See TracChangeset
for help on using the changeset viewer.