<DIV class=box id=top_bar>Web Tools--Ajax Version </DIV><BR>
<DIV class="box general"> 天气预报: <INPUT id=Weather size=17
value=北京> <INPUT onclick=getWeather() type=button value="提 交" name=submit> <SPAN
id=Disp_Weather></SPAN></DIV>
<DIV class="box general"> IP地址查询: <INPUT id=Ip maxLength=17 size=17
value=127.0.0.1> <INPUT onclick=getIp() type=button value="提 交" name=submit> <SPAN
id=Disp_IPArea></SPAN></DIV>
<DIV class="box general">手机归属查询: <INPUT id=Mobile maxLength=15 size=17 value=13>
<INPUT onclick=getMobile() type=button value="提 交"> <SPAN
id=Disp_MobileArea></SPAN></DIV>
<SCRIPT language=JavaScript type=text/javascript>
chgBtnStyle();
</SCRIPT>
//针对不同的浏览器获取指定的id对象
function getObj(objID) {
return document.all ? document.all[objID] : document.getElementById(objID);
}
var req;
//使用xmlrequest对象
function createXHR() {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (E) {
req = false;
}
}
if (!req && typeof XMLHttpRequest != "undefined") {
req = new XMLHttpRequest();
}
}
function getWeather() {
createXHR();
req.open("GET", "weather.asp?City=" + getObj("Weather").value, true);
req.send();
req.onreadystatechange = handleStateChange1;
}
function handleStateChange1() {
if (req.readyState<4){getObj("Disp_Weather").innerText = "正在查询["+getObj("Weather").value+"]天气状况..."}
else if (req.readyState == 4 && req.status == 200) {
getObj("Disp_Weather").innerText = req.responseText;
} else {
getObj("Disp_Weather").innerText = "\u67e5\u8be2\u8fc7\u7a0b\u51fa\u73b0\u8fc7\u7a0b\uff0c\u8bf7\u91cd\u8bd5\u6216\u8054\u7cfb\u7ba1\u7406\u5458\uff01";
}
}
function checkip() {
var ipArray, ip, j;
ip = getObj("Ip").value;
if (/[^\d\.]/.test(ip)) {
return false;
}
ipArray = ip.split(".");
if (ipArray.length != 4) {
return false;
}
for (var i = 0; i < 4; i++) {
if (ipArray[i].length == 0 || ipArray[i] > 255) {
return false;
}
}
return true;
}
function getIp() {
if (checkip()) {
createXHR();
req.open("GET", "IpSearch.asp?IP=" + getObj("Ip").value, true);
req.send();
req.onreadystatechange = handleStateChange;
} else {
getObj("Disp_IPArea").innerText = "\u8fd4\u56de\u9519\u8bef\uff1a\u4e0d\u662f\u6b63\u786e\u7684ip";
}
}
function handleStateChange() {
if (req.readyState<4){getObj("Disp_IPArea").innerText = "正在查询ip["+getObj("Ip").value+"]..."}
else if (req.readyState == 4 && req.status == 200) {
getObj("Disp_IPArea").innerText = req.responseText;
} else {
getObj("Disp_IPArea").innerText = "\u67e5\u8be2\u8fc7\u7a0b\u51fa\u73b0\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5\u6216\u8054\u7cfb\u7ba1\u7406\u5458\uff01";
}
}
function checkMobile() {
var sMobile = getObj("Mobile").value;
if (!(/^13[0-9]\d{4,8}$/.test(sMobile))) {
return false;
}
return true;
}
function getMobile() {
if (checkMobile()) {
createXHR();
req.open("GET", "MobileSearch.asp?Mobile=" + getObj("Mobile").value, true);
req.send();
req.onreadystatechange = handleStateChange2;
} else {
getObj("Disp_MobileArea").innerText = "\u8fd4\u56de\u9519\u8bef\uff1a\u4e0d\u662f\u5b8c\u6574\u768411\u4f4d\u624b\u673a\u53f7\u6216\u8005\u6b63\u786e\u7684\u624b\u673a\u53f7\u524d\u4e03\u4f4d";
}
}
function handleStateChange2() {
if (req.readyState<4){getObj("Disp_MobileArea").innerText = "正在查询手机号码["+getObj("Mobile").value+"]..."}
else if (req.readyState == 4 && req.status == 200) {
getObj("Disp_MobileArea").innerText = req.responseText;
} else {
getObj("Disp_MobileArea").innerText = "\u67e5\u8be2\u8fc7\u7a0b\u51fa\u73b0\u9519\u8bef\uff0c\u8bf7\u91cd\u8bd5\u6216\u8054\u7cfb\u7ba1\u7406\u5458\uff01";
}
}
function chgBtnStyle(){
var btn=document.getElementsByTagName("input")
for(var i=0;i<btn.length;i++){
if(btn[i].type=='button'){
btn[i].className="btnStyle";
}
}
}
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
更新日志
- 陈致逸《幻想乐园 Fantasyland》[320K/MP3][120.54MB]
- 席卷全球最红舞曲《火辣辣DJ[英文版]》[DTS-WAV]
- 群星-席卷全球最红舞曲《火辣辣DJ中文版》【WAV】
- 模拟之声慢刻CD《声入人心[年度发烧人声严选]》[低速原抓WAV+CUE]
- 陈致逸《幻想乐园 Fantasyland》[FLAC/分轨][554.27MB]
- Rhymist / LusciousBB《年轮》[320K/MP3][76.52MB]
- Rhymist / LusciousBB《年轮》[FLAC/分轨][410.02MB]
- 群星《歌手2024 第11期》[320K/MP3][93.88MB]
- 群星《歌手2024 第11期》[FLAC/分轨][496.06MB]
- 群星《国风超有戏 第7期》[320K/MP3][30.73MB]
- 模拟之声慢刻CD《试音天品8[女声低音炮]》[低速原抓WAV+CUE]
- 群星《抖烧第三季DSD》[低速原抓WAV+CUE]
- [ABC]蔡琴《百万琴歌[6N纯银镀膜]》[低速原抓WAV+CUE]
- 群星《国风超有戏 第7期》[FLAC/分轨][147.99MB]
- 群星《闪光的夏天 第3期》[320K/MP3][61.94MB]