Changeset 16591 for schedule/Module/calendar.php
- Timestamp:
- 06/02/13 15:54:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16590 r16591 97 97 <script type="text/javascript"> 98 98 99 function testData()100 {101 //calls the xml request in a loop based on the current sources102 var source = ['Mrk 421','Mrk 501'];103 for (i = 0; i<source.length; i++)104 {105 testXMLData(i, source);106 }107 }108 109 function testXMLData(index, source)110 {111 var testXML;112 testXML = new XMLHttpRequest();113 //NOTE: previous errors on the request was caused by appending "http://www.fact-project.org"114 testXML.open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true);115 dataSource = new Array();116 testXML.onload=function() {117 if (testXML.status==200)118 {119 line=testXML.responseText.split('\n');120 dataSource.push(line);121 if (dataSource.length == source.length)122 {123 displayXMLData(dataSource, source); //this will be called when the last data from the list is read124 }125 }126 testXML.send();127 }128 129 function displayXMLData(dataSource, source)130 {131 //This function splits the lines of data per data source132 var dataGraph = new Array(source.length);133 for (i=0; i<source.length; i++)134 {135 dataGraph[i] = new Array(); //dataGraph contains the individual points for each source i136 for(row=0;row<dataSource[i].length;row++)137 {138 rows=line[row].split(',');139 dataGraph[i].push(rows[4]);140 $('#data').append(i + ' GRAPH DATA ' + dataGraph[i]);141 }142 }143 }144 99 145 100 CAL.addEventListener("onSelect", function(){ … … 148 103 year =this.selection.print("%Y").join("\n"); 149 104 //document.getElementById('data').innerHTML="Calendar selected! "; 150 testData();105 //testData(); 151 106 152 107 });
Note:
See TracChangeset
for help on using the changeset viewer.