This is a discussion on "Detect whether connection to external url is possible" within the Classic ASP section. This forum, and the thread "Detect whether connection to external url is possible are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Detect whether connection to external url is possible
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Detect whether connection to external url is possible
Hi, I have a little problem with a script which I set up a while back. The script connects to a text file on a product supplier's site which has lists of all of the products which are currently in stock. I then run a script to update my database with all out of stock products so that they don't appear on my site.
It works like a dream, except that BT just cut the cables for the suppliers web server. This means that my script can't connect to the text file, and I get horrible error messages. Does anybody know how to implement an error detection that will prevent the script from running if the connection to the external text document cannot be made. I obviously want it so that the script is simply ignored, and no error messages are presented. Is there a script which says "if this url can be found then run the script below" My connection code below:
|
|
|
|
||||
|
I'm not 100% sure, but I'm pretty sure the objXmlHttp.open or objXmlHttp.send methods have return values.
If not, you could use on error resemu next and check for the existance of an err value (which will indicate there was a problem connecting) Hope this helps.
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
|
|||
|
aha!
Thanks for this. The document I'm trying to connect to is working ok again now, so all is well. I've tried connecting to a document that doesn't exist, or a domain that doesn't exist, and script times out though. I don't know wheteher I'm accurately simulating their server going down by doing this. Thanks though, this certainly helps. Si. |
![]() |
| Tags |
| detect, whether, connection, external, url, possible |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Detect mouse location etc.... | abrogard | JavaScript Forum | 1 | Dec 6th, 2007 12:22 |
| Popup Name Detect | RobinDeanDotCom | JavaScript Forum | 0 | Feb 24th, 2007 22:35 |
| Detect IE | Totti | JavaScript Forum | 4 | Dec 6th, 2006 00:48 |
| Possible to detect which stylesheet in use? | mar2195 | JavaScript Forum | 9 | Nov 25th, 2006 11:43 |
| detect pop-up blocker - different | bert | JavaScript Forum | 0 | Jul 22nd, 2005 10:30 |