OSDN Git Service

wits update
[vem/WITs.git] / JS / stagecontrol.js
1
2 function stagecontrol(command,absolutex,absolutey,absolutez,absolutea) {
3
4  var ajax=getAjax();
5
6  if(command == "stage"){
7         var result = document.getElementById("stage");
8         }else {
9                 var result = document.getElementById("stage");
10         }
11
12         if (ajax) {
13                  try{
14                          ajax.onreadystatechange = getData;
15                  }catch(e){
16                         result.innerHTML="Onreadystate change error.";
17                  }
18
19                  try{
20                         ajax.open("GET","//localhost:9090/="+encodeURIComponent(command)+"&x="+encodeURIComponent(absolutex)+"&y="+encodeURIComponent(absolutey)+"&z="+encodeURIComponent(absolutez)+"&a="+encodeURIComponent(absolutea),true);
21                         //document.getElementById("mid").innerHTML="absolutex="+absolutex+" absolutey="+absolutey;
22                  }catch(e){
23                         result.innerHTML = "ajax open error";
24                  }
25
26                 try {
27                          ajax.send(null);
28                 }catch (e) {
29                         result.innerHTML ="send error";
30                 }
31
32         }else {
33                 result.innerHTML = "you cannot use ajax....";
34         }
35
36         function getData() {
37                         if (ajax.readyState==4) {
38                                         if (ajax.status==200) {
39                                                          result.innerHTML = ajax.responseText;
40                                                  }else {
41                                                          result.innerHTML = "HTTP transmission....";
42                                                 }
43                          }
44         }
45  }