I dont know any VB Script just to tell ya.
I want to use vb script to see if a website exists. If it does then go to it, otherwise go to a different one. Is this possible?
p.s. Client side
Printable View
I dont know any VB Script just to tell ya.
I want to use vb script to see if a website exists. If it does then go to it, otherwise go to a different one. Is this possible?
p.s. Client side
Code:<script language="VBScript">
msgbox(VerifySite("http://www.vbforums.com"))
msgbox(VerifySite("http://www.asl;fjasdlfkjasd;lf.com"))
function VerifySite(SiteName)
on error resume next
dim objXMLHTTP
dim strText
set objXMLHTTP = createobject("Microsoft.XMLHTTP")
objxmlhttp.open "GET", SiteName, false
objxmlhttp.send
strText = objxmlhttp.responsetext
if trim(strText) = "" then
VerifySite = false
else
VerifySite = true
end if
set objxmlhttp = nothing
end function
</script>
Thank you very much!!! Thats exactly what I wanted :D :D :D
Can you also use that object to go to a site and find it's title?
Cheers!
I'll be using that to find out names of sites when people type in addresses, in my forums :D