-
Notifications
You must be signed in to change notification settings - Fork 0
/
slider-setup.js
64 lines (58 loc) · 1.48 KB
/
slider-setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
var slider=new Array();
slider[1]=new Object();
slider[1].min=1;
slider[1].max=40;
slider[1].val=0;
slider[1].onchange=updateresults;
var lastUpdate;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
function setBoxValue(val, box) {
var b=document.getElementById('output'+box);
b.value=val;
}
function updateresults(val, box) {
var xmlhttp;
val=Math.round(val);
console.log(val);
if (window.XMLHttpRequest)
{
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
alert("Your browser does not support XMLHTTP!");
}
var url="ajaxzoomreturn.php";
url=url+"?zoom="+val;
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
{
if(xmlhttp.status == 200) {
var htmlval = xmlhttp.responseXML ;
document.getElementById("results").innerHTML = xmlhttp.responseText;
}
}
}
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function useHttpResponse(){
var state = xmlhttp.readyState;
if (state == 4) {
if(xmlhttp.status == 200) {
var htmlval = http.responseXML ;
document.getElementById("results").innerHTML = "Here";
}
} else {
document.getElementById("results").innerHTML = "Please wait just a moment";
}
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */