SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    can JavaScript check a link?

    I am reading Enhancing Structural Markup with JavaScript by Simon Willison. In his first example he shows how to make the cite=someurl attribute of a <blockquote> tag visible and clickable in the browser.

    I was thinking it would be nice if the script could check the validity of the URL (does the target page exist?) before displaying to the html page.

    Is that possible with JavaScript?

    Thanks for any insights.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,604
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    You would need to use Ajax to send the request to the server and have the server test if the destination page exists.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •