By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,287 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

How do I programmatically (javascript) check if link is valid in html?

P: n/a
How do I programmatically (javascript) check if link is valid in html?

Mar 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Mar 7, 5:18 pm, "Chandra" <bschandramo...@gmail.comwrote:
How do I programmatically (javascript) check if link is valid in html?
Search for "Does a url exist?" at:

<URL: http://www.jibbering.com/2002/4/httprequest.html >
--
Rob

Mar 7 '07 #2

P: n/a
In comp.lang.javascript message <11*********************@p10g2000cwp.goo
glegroups.com>, Wed, 7 Mar 2007 00:58:41, RobG <rg***@iinet.net.au>
posted:
>On Mar 7, 5:18 pm, "Chandra" <bschandramo...@gmail.comwrote:
>How do I programmatically (javascript) check if link is valid in html?

Search for "Does a url exist?" at:

<URL: http://www.jibbering.com/2002/4/httprequest.html >
So, on page load, an author can do various things amounting to a
probable abuse of resources.
OTOH, the code to check all the URLs on a page could be put in an
include file on an author's own machine, with a dummy version on the
author's public site; and that code could be actuated by a code-written
button so that it was not used too often. Such code could be published
for distribution by using /* ... */ to disable its workings. Has anyone
done that?
And HEAD can be used to find the Last-Modified date which is the well-
defined unambiguous form from which lastModified is derived often by the
removal of unambiguity. I've created temporary page
<URL:http://www.merlyn.demon.co.uk/lastzmod.htm>
which uses it in addition and will replace last-mod.htm if all seems
well.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20 ; WinXP.
Web <URL:http://www.merlyn.demon.co.uk/- FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via <URL:http://www.merlyn.demon.co.uk/programs/00index.htm>
My DOS <URL:http://www.merlyn.demon.co.uk/batfiles.htm- also batprogs.htm.
Mar 7 '07 #3

P: n/a
Dr J R Stockton said the following on 3/7/2007 9:43 AM:
In comp.lang.javascript message <11*********************@p10g2000cwp.goo
glegroups.com>, Wed, 7 Mar 2007 00:58:41, RobG <rg***@iinet.net.au>
posted:
>On Mar 7, 5:18 pm, "Chandra" <bschandramo...@gmail.comwrote:
>>How do I programmatically (javascript) check if link is valid in html?
Search for "Does a url exist?" at:

<URL: http://www.jibbering.com/2002/4/httprequest.html >

So, on page load, an author can do various things amounting to a
probable abuse of resources.
That is true without using an httprequest. A clock, on a webpage, is a
"probable abuse of resources", and, it has nothing to do with whether it
is on page load or not.
OTOH, the code to check all the URLs on a page could be put in an
include file on an author's own machine, with a dummy version on the
author's public site; and that code could be actuated by a code-written
button so that it was not used too often. Such code could be published
for distribution by using /* ... */ to disable its workings. Has anyone
done that?
No because it doesn't make any sense. If you only want to show a user a
link if that server/URL is available then your testing doesn't satisfy
that need.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 8 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.