About checking an existing URL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    About checking an existing URL

    Is there a function on JavaScript that checks the specified url if it exists or not?

    ergo,

    while loading a page, the script must check first the other page if it exists, redirect if not exists.

    The purpose is for the maintenance.... .
    If we will do changes etc for the website, we should remove that page(always checked) so that, any users that tries to access the site or its sub directories will be redirected to a specific page ( Site under maintenance ).....

    This is what im thinking now..... any suggestions or links for tutorial will be appreciated....

    looking forward to your replies experts,
    sukatoa
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Yeah, sure, just make an Ajax head request.

    Comment

    • sukatoa
      Contributor
      • Nov 2007
      • 539

      #3
      Originally posted by acoder
      Yeah, sure, just make an Ajax head request.
      Thanks for your reply, i don't know AJAX yet....

      Can you post some recommended URLs that could teach me how to deal with it?

      Im not sure on google's suggestions.... .

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        For Ajax tutorials, see the Offsite Links sticky thread. For your specific problem, see this link (section "Does a URL exist?").

        Note that this is the option client-side since you asked in this forum. You could also make an HTTP request server-side.

        Comment

        • sukatoa
          Contributor
          • Nov 2007
          • 539

          #5
          Originally posted by acoder
          For Ajax tutorials, see the Offsite Links sticky thread. For your specific problem, see this link (section "Does a URL exist?").

          Note that this is the option client-side since you asked in this forum. You could also make an HTTP request server-side.
          I never thought that the content of that sticky thread have more tutorials about JavaScript
          That URL really helped me.... thanks acoder.... :)

          I got this Prototype API , is this the nice one to be used for beginners like me? or can you recommend another one that fits my level?

          Thanks again for the url acoder....

          sukatoa

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            You could use that. Another popular one is jQuery and there are others. If you're a beginner to JavaScript, be sure to use one with good documentation/tutorials.

            Comment

            Working...