OSDN Git Service

20140826WITs
[vem/WITs.git] / JS / stagecontrol.js~
diff --git a/JS/stagecontrol.js~ b/JS/stagecontrol.js~
new file mode 100644 (file)
index 0000000..7568b1a
--- /dev/null
@@ -0,0 +1,45 @@
+
+function stagecontrol(command,absolutex,absolutey,absolutez,absolutea) {
+ var ajax=getAjax();
+ if(command == "detailcatch"){
+       var result = document.getElementById("detail");
+  }else {
+       var result = document.anchorsgetElementById("result");
+  }
+  
+  if (ajax) {
+        try{
+          ajax.onreadystatechange = getData;
+        }catch(e){
+      result.innerHTML="Onreadystate change error.";    
+        }
+        
+        try{
+      ajax.open("GET","//localhost:8000/cgi-bin/vemclient.rb?command="+encodeURIComponent(command)+"&x="+encodeURIComponent(absolutex)+"&y="+encodeURIComponent(absolutey)+"&z="+encodeURIComponent(absolutez)+"&a="+encodeURIComponent(absolutea),true);
+      //document.getElementById("mid").innerHTML="absolutex="+absolutex+" absolutey="+absolutey;        
+        }catch(e){
+      result.innerHTML = "ajax open error";
+        }
+
+    try {
+        ajax.send(null);
+    }catch (e) {
+      result.innerHTML ="send error";
+    }
+    
+  }else {
+       result.innerHTML = "you cannot use ajax....";
+  }
+  
+  function getData() { 
+      if (ajax.readyState==4) {
+          if (ajax.status==200) {
+               result.innerHTML = ajax.responseText; 
+             }else {
+               result.innerHTML = "HTTP transmission....";
+            }
+       }
+  }
+ }
\ No newline at end of file