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

  • Follow


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

0
Reply bschandramohan (5) 3/7/2007 7:18:33 AM

On Mar 7, 5:18 pm, "Chandra" <bschandramo...@gmail.com> wrote:
> 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

0
Reply RobG 3/7/2007 8:58:41 AM


In comp.lang.javascript message <1173257921.111123.61630@p10g2000cwp.goo
glegroups.com>, Wed, 7 Mar 2007 00:58:41, RobG <rgqld@iinet.net.au>
posted:
>On Mar 7, 5:18 pm, "Chandra" <bschandramo...@gmail.com> wrote:
>> 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.
0
Reply Dr 3/7/2007 2:43:09 PM

Dr J R Stockton said the following on 3/7/2007 9:43 AM:
> In comp.lang.javascript message <1173257921.111123.61630@p10g2000cwp.goo
> glegroups.com>, Wed, 7 Mar 2007 00:58:41, RobG <rgqld@iinet.net.au>
> posted:
>> On Mar 7, 5:18 pm, "Chandra" <bschandramo...@gmail.com> wrote:
>>> 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/
0
Reply Randy 3/8/2007 7:13:19 PM

3 Replies
128 Views

(page loaded in 0.057 seconds)

Similiar Articles:













7/27/2012 6:58:10 PM


Reply: