用xmlhttp判断url是否存在
2004-08-09 19:21
351 查看
///js 代码:
〈SCRIPT LANGUAGE=“JavaScript“〉
function isExist(url) {
xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP“)
xmlhttp.open(“GET“,url,false)
xmlhttp.send()
if(xmlhttp.status==200)
alert(url+“ 存在“)
else
alert(url+“ 不存在“)
}
〈/SCRIPT〉
〈input type=“button“ onclick=“isExist(’http://www.sayee.com/cloudchen/js/myCalendar.htm’)“ value=“检测url是否存在“〉
///asp 代码:
Function getHTTPPage(url)
dim http
set http=Server.createobject(“Microsoft.XMLHTTP“)
Http.open “GET“,url,false
Http.send()
if Http.readystate 〈〉 4 then
exit function
else
getHTTPPage = http.status
end if
set http=nothing
if err.number〈〉0 then err.Clear
end function
〈SCRIPT LANGUAGE=“JavaScript“〉
function isExist(url) {
xmlhttp = new ActiveXObject(“Microsoft.XMLHTTP“)
xmlhttp.open(“GET“,url,false)
xmlhttp.send()
if(xmlhttp.status==200)
alert(url+“ 存在“)
else
alert(url+“ 不存在“)
}
〈/SCRIPT〉
〈input type=“button“ onclick=“isExist(’http://www.sayee.com/cloudchen/js/myCalendar.htm’)“ value=“检测url是否存在“〉
///asp 代码:
Function getHTTPPage(url)
dim http
set http=Server.createobject(“Microsoft.XMLHTTP“)
Http.open “GET“,url,false
Http.send()
if Http.readystate 〈〉 4 then
exit function
else
getHTTPPage = http.status
end if
set http=nothing
if err.number〈〉0 then err.Clear
end function
相关文章推荐
- C#判断网络地址 Url 是否存在的方法
- ASP_NET判断URL参数是否存在
- php判断URL参数中是否存在某些项
- java判断url地址是否存在
- 判断URL是否存在
- 判断URL是否存在
- 根据url读取图片,直接压缩写到zip流【含判断url地址是否存在】
- 判断url是否存在某个字符
- jsp url文件判断是否存在
- 判断网页URL是否存在
- ASP.NET判断URL参数是否存在
- 判断URL是否存在
- C#判断网络地址 Url 是否存在的方法
- PHP判断远程图片或文件或url是否存在
- 通过URL判断文件是否有存在
- 分别从客户端和服务端判断远程URL是否存在的方法
- 判断URL是否存在
- 判断网页URL是否存在
- JS判断window本地路径地址和网络url地址文件时是否存在
- xmlhttp判断文件是否存在