javascript保存变量的问题
还是asp页面实现空调遥控器的问题,现在想实现的功能:第一次使用完遥控器后,将页面上设定的各个值保存,等第二次打开页面时,显示的是第一次使用完之后的值,类似空调遥控器。比如第一次设置温度为27度,等第二次打开页面,温度仍显示27度,脚本用javascript。如何实现,请高手指点!给出源码,谢谢先。
这是我脚本的部分代码:
<script language="javascript">
var arrImg=new Array("17.jpg","18.jpg","19.jpg","20.jpg","21.jpg","22.jpg","23.jpg","24.jpg","25.jpg","26.jpg",
"27.jpg","28.jpg","29.jpg","30.jpg","31.jpg");
var i=8;
var pic=1;
document.getElementById("imgFld").src=arrImg[8];
document.getElementById("imgFld").attachEvent(onclick,function(){window.open(document.getElementById("imgFld").src);});
function prevImg() {
if(i==0) return;
i--;
document.getElementById("imgFld").src=arrImg[i];
pic--;
whichpic.innerHTML =pic;
}
document.all.TempShow.value=i+17;
function nextImg() {
if(i==arrImg.length-2) return;
i++;
pic++;
document.getElementById("imgFld").src=arrImg[i];
whichpic.innerHTML =pic;
}
document.all.TempShow.value=i+17;
function save(){
document.getElementById("imgFld").src=arrImg[i];
document.getElementById("imgmode").src=arrmode[j];
document.getElementById("imgwindspeed").src=arrwindspeed[s];
}
function loadimg(){
document.getElementById("imgFld").src=arrImg[i];
document.getElementById("imgmode").src=arrmode[j];
document.getElementById("imgwindspeed").src=arrwindspeed[s];
whichpic.innerHTML =pic;
}
function switchcontroll(){
document.getElementById("imgFld").src=arrImg[8];
whichpic.innerHTML =pic;
}
whichpic.innerHTML =pic;
</script>
<script language="javascript">
var arrmode=new Array("0.jpg","1.jpg","2.jpg","3.jpg","4.jpg");
var j=0;
document.getElementById("imgmode").src=arrmode[0];
document.getElementById("imgmode").attachEvent(onclick,function(){window.open(document.getElementById("imgmode").src);});
function modeselect(){
document .getElementById("imgmode").src=arrmode[j];
j=(j+1)%5;
whichpic.innerHTML =pic;
}
document.all.ModeControll.value=j;
</script>
<script language="javascript">
var arrwindspeed=new Array("5.jpg","6.jpg","7.jpg","8.jpg");
var s=0;
document.getElementById("imgwindspeed").src=arrwindspeed[0];
document.getElementById("imgwindspeed").attachEvent(onclick,function(){window.open(document.getElementById("imgwindspeed").src);});
function windspeedselect(){
document .getElementById("imgwindspeed").src=arrwindspeed[s];
s=(s+1)%4;
whichpic.innerHTML =pic;
}
document.all.WindSpeedControll.value=s;
</script>