]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
fixed error with the getdata method, outsourced getdata to getdata.js, added random...
authorMichael Wiebusch <stratomaster@gmx.net>
Thu, 1 Aug 2013 14:01:52 +0000 (16:01 +0200)
committerMichael Wiebusch <stratomaster@gmx.net>
Thu, 1 Aug 2013 14:01:52 +0000 (16:01 +0200)
tools/getdata.js [new file with mode: 0644]
tools/jtageditor.pl
tools/testgui.js
tools/testgui.pl

diff --git a/tools/getdata.js b/tools/getdata.js
new file mode 100644 (file)
index 0000000..3dc5cc4
--- /dev/null
@@ -0,0 +1,24 @@
+function getdata(command,dId,async) {
+  
+//   alert("caller is " + arguments.callee.caller.toString());
+  
+  var xmlhttp = null;
+  //var cb = null;
+  xmlhttp=new XMLHttpRequest();
+  //cb = callback;
+  var destId = dId;
+  
+  xmlhttp.onreadystatechange = function() {
+    if(xmlhttp.readyState == 4 && xmlhttp.status==200) {
+      //if(cb)
+  if(document.getElementById(destId)){
+  document.getElementById(destId).innerHTML  = xmlhttp.responseText;  
+  }
+        //cb(xmlhttp.responseText);
+  //document.getElementById(destId).innerHTML  = xmlhttp.responseText;  
+      }
+    }
+
+  xmlhttp.open("GET",command,async);
+  xmlhttp.send(null);
+  }
\ No newline at end of file
index 3b26c59b5b731dda167b4974ae35fdd08cf5ce65..51063ce9a5e8ee5b440606205108b946a47f677a 100755 (executable)
@@ -782,29 +782,7 @@ for(var i = 0; i < array.length; i++)
 
 </script>
 
-<script language="javascript">
-function getdata(command,dId,async) {
-  var xmlhttp = null;
-  //var cb = null;
-  xmlhttp=new XMLHttpRequest();
-  //cb = callback;
-  var destId = dId;
-  
-  xmlhttp.onreadystatechange = function() {
-    if(xmlhttp.readyState == 4 && xmlhttp.status==200) {
-      //if(cb)
-  if(document.getElementById(destId).innerHTML){
-  document.getElementById(destId).innerHTML  = xmlhttp.responseText;  
-  }
-        //cb(xmlhttp.responseText);
-  //document.getElementById(destId).innerHTML  = xmlhttp.responseText;  
-      }
-    }
-
-  xmlhttp.open("GET",command,async);
-  xmlhttp.send(null);
-  }
-</script>
+<script language="javascript" src="getdata.js"></script>
 EOF
 
 }
index 9e700ba8e18abcb6b7902c7ed817a8af86b1da27..a6d530d75376d59d3886b1cea5813b375010b2d2 100644 (file)
@@ -1,24 +1,4 @@
-function getdata(command,dId,async) {
-  var xmlhttp = null;
-  //var cb = null;
-  xmlhttp=new XMLHttpRequest();
-  //cb = callback;
-  var destId = dId;
-  
-  xmlhttp.onreadystatechange = function() {
-    if(xmlhttp.readyState == 4 && xmlhttp.status==200) {
-      //if(cb)
-  if(document.getElementById(destId).innerHTML){
-  document.getElementById(destId).innerHTML  = xmlhttp.responseText;  
-  }
-        //cb(xmlhttp.responseText);
-  //document.getElementById(destId).innerHTML  = xmlhttp.responseText;  
-      }
-    }
 
-  xmlhttp.open("GET",command,async);
-  xmlhttp.send(null);
-  }
   
   
   
index 16ee6ba4491e6132bb2db291e34d3b2f78dfa982..42529fe964c18ca74fc93bd072dd71121651c5cf 100755 (executable)
@@ -112,6 +112,7 @@ print start_html(
 ],
 -script=>[
 { -type => 'text/javascript', -src => './testgui.js'},
+{ -type => 'text/javascript', -src => './getdata.js'},
 { -type => 'text/javascript', -src => './xmlOperations.js'}
 ]
 );