Test URL before using it?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Oschler

    #1

    Test URL before using it?

    I'd like to be able to see if a URL was functional before I attempt to put
    it in an IFrame. Is there a way to do this so I can prevent the user from
    ending up with a 404 error page in the IFrame?

    thx

    --

    Robert Oschler
    "Let the web hear you, add your voice to your web site in minutes!"
    -- http://audiodirect.spiderchase.com/
    (For a limited time, free voiceover with every sign-up, use this link
    instead)
    -- http://audio.spiderchase.com/


  • Grant Wagner

    #2
    Re: Test URL before using it?

    Robert Oschler wrote:
    [color=blue]
    > I'd like to be able to see if a URL was functional before I attempt to put
    > it in an IFrame. Is there a way to do this so I can prevent the user from
    > ending up with a 404 error page in the IFrame?
    >
    > thx
    >
    > --
    >
    > Robert Oschler[/color]

    If you know your users are going to be using IE6+ and Netscape 7+, you could
    use the XML HTTP Request object to check for the page prior to changing the
    location of the iframe:

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

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    http://msdn.microsoft.com/workshop/a...ence_entry.asp

    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    • kaeli

      #3
      Re: Test URL before using it?

      In article <jvDPa.11419$Hw .8767317@news2. news.adelphia.n et>,
      no_replies@fake _email_address. invalid shared the illuminating thought...[color=blue]
      > I'd like to be able to see if a URL was functional before I attempt to put
      > it in an IFrame. Is there a way to do this so I can prevent the user from
      > ending up with a 404 error page in the IFrame?
      >[/color]

      Not with javascript if the page is from a different domain, which I
      assume it is or you'd know if it was there.
      Could be done with dynamically generated pages (server-side), such as
      JSP/servlet, using a language that understands URLs.


      ----------------------------------------
      ~kaeli~


      Jesus saves, Allah protects, and Cthulhu
      thinks you'd make a nice sandwich.
      ----------------------------------------

      Comment

      Working...