以下代碼實現ajax正在提交效果:loading....
<script>
function load1(name)
{
loading.style.display="none";
name.style.display="";
}
function selecte(s)
{
if(s==1)
{
loading.style.display="";
div_b.style.display="none";
div_c.style.display="none";
div_d.style.display="none";
setTimeout("load1(div_a)",2000);
}
if(s==2)
{
loading.style.display="";
div_a.style.display="none";
div_c.style.display="none";
div_d.style.display="none";
setTimeout("load1(div_b)",2000);
}
if(s==3)
{
loading.style.display="";
div_a.style.display="none";
div_b.style.display="none";
div_d.style.display="none";
setTimeout("load1(div_c)",2000);
}
if(s==4)
{
loading.style.display="";
div_a.style.display="none";
div_b.style.display="none";
div_c.style.display="none";
setTimeout("load1(div_d)",2000);
}
}
</script>
<select name="singerarea"
onchange="selecte(this.options[this.options.selectedIndex].value)">
<option value="0">請選擇</option>
<option value="1">CssRain1</option>
<option value="2">CssRain2</option>
<option value="3">CssRain3</option>
<option value="4">CssRain4</option>
</select>
<div id="loading" style="display:none;">
<img src="yun_qi_img/loading.gif">
</div>
<div id="div_a" style="display:none;" >
<input type="text" value="1111111">
</div>
<div id="div_b" style="display:none;" >
你選擇了 地區2
</div>
<div id="div_c" style="display:none;" >
<input type="button" value="button">
</div>
<div id="div_d" style="display:none;" >
from cssrain js demo.
</div>