Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getParamData() {
- var xhr = new XMLHttpRequest();
- xhr.timeout = 2000;
- xhr.ontimeout = function() {
- console.log("TimeOut getParamData");
- gId("xerror").innerHTML="TimeOut getParamData"
- };
- xhr.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- //console.log(this.responseText);
- var index = 0;
- var tb=this.responseText.split(";");
- gId("tp1").value = tb[index++];
- gId("tp2").value = tb[index++];
- gId("tp3").value = tb[index++];
- }
- };
- xhr.open("GET", "getParamData", true);
- xhr.send();
- }
- function gId(id) {
- return document.getElementById(id);
- }
- getParamData();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement