2 console.log("program move");
3 function emnamecatch(name){
8 function emcondition(command) {
12 if (command == "request") {
13 var position1 = document.getElementById("Position");
14 var SpotsizeIndex = document.getElementById("SpotsizeIndex");
15 var MagIndex = document.getElementById("MagIndex");
16 var Obj = document.getElementById("Obj");
17 var BeamTilt = document.getElementById("BeamTilt");
18 var Speed = document.getElementById("Speed");
20 var position1 = document.anchorsgetElementById("result");
25 ajax.onreadystatechange = getData;
27 position1.innerHTML = "Onreadystate change error.";
30 ajax.open("GET", "//localhost:9090/"+encodeURIComponent(emname)+"/get", true);
31 console.log("//localhost:9090/"+encodeURIComponent(emname)+"/get");
33 position1.innerHTML = "ajax open error";
38 position1.innerHTML = "send error";
42 position1.innerHTML = "you cannot use ajax....";
46 if (ajax.readyState == 4) {
47 if (ajax.status == 200) {
48 console.log("Hello!");
49 var resultjson = ajax.responseText;
50 resultjson = JSON.parse(resultjson);
51 console.log(typeof resultjson);
53 for (key in resultjson) {
54 console.log(key+":"+resultjson(key));
57 //position1.innerHTML=resultjson;
58 position1.innerHTML = "x=" + resultjson["GonionX"] + " y=" + resultjson['GonionY'] + " z=" + resultjson['GonionZ'] + " a=" + resultjson['GonionA'];
59 SpotsizeIndex.innerHTML = "Spotsize:" + resultjson['SpotsizeIndex'];
60 MagIndex.innerHTML = "MagIndex:" + resultjson['MagIndex'];
61 Obj.innerHTML = "Obj:" + resultjson['Obj'];
62 BeamTilt.innerHTML = "BeamTilt:" + resultjson['BeamTilt'];
63 Speed.innerHTML = "Speed:" + resultjson['Speed'];
64 // result.innerHTML = ajax.responseText;
66 position1.innerHTML = "HTTP transmission....";