Page Not Found

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yvon Kephren

    Page Not Found

    Hey, I have a javascript problem and I can think of two solutions.
    First of all the problem. I have a script that dynamically loads pages
    in iframes on the fly. Sometimes it is possible that these pages do
    not exist. So Mozilla alerts me that the page cannot be found. My
    question is can I omit the Alert or throw an exception some how or
    test if the page exists before hand

    Now to my solutions, if when mozilla cannot find the page it would
    also throw an exception so I could test to see if it wasnt loaded so I
    could make my own Error report instead of an alert. Or secondly if I
    could some how test before hand if the file existed.

    Any one care to enlighten me on this subject, Thanks.
  • chotiwallah

    #2
    Re: Page Not Found

    fc199@ncf.ca (Yvon Kephren) wrote in message news:<868d72a7. 0406160459.1ee1 66a3@posting.go ogle.com>...[color=blue]
    > Hey, I have a javascript problem and I can think of two solutions.
    > First of all the problem. I have a script that dynamically loads pages
    > in iframes on the fly. Sometimes it is possible that these pages do
    > not exist. So Mozilla alerts me that the page cannot be found. My
    > question is can I omit the Alert or throw an exception some how or
    > test if the page exists before hand
    >
    > Now to my solutions, if when mozilla cannot find the page it would
    > also throw an exception so I could test to see if it wasnt loaded so I
    > could make my own Error report instead of an alert. Or secondly if I
    > could some how test before hand if the file existed.
    >
    > Any one care to enlighten me on this subject, Thanks.[/color]

    why not use a customized error404-doc, loaded trough .htaccess?

    Comment

    • Yvon Kephren

      #3
      Re: Page Not Found

      In Mozilla there is no 404 error page. There is just an alert that
      states the url of the document cannot be found and the page remains
      blank or keeps the content previously on the screen.

      My problem is not in Internet Explorer, Souly in Mozilla there is an
      alert that I would like to avoid.



      *** Sent via Devdex http://www.devdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Grant Wagner

        #4
        Re: Page Not Found

        Yvon Kephren wrote:
        [color=blue]
        > In Mozilla there is no 404 error page. There is just an alert that
        > states the url of the document cannot be found and the page remains
        > blank or keeps the content previously on the screen.
        >
        > My problem is not in Internet Explorer, Souly in Mozilla there is an
        > alert that I would like to avoid.[/color]

        The way to avoid the alert is to have your server not generate 404 HTTP
        responses. This is what the original reply to your post is saying.

        The way to avoid sending 404 HTTP responses is to have your server
        redirect to a 404 error page (handler) so that a 404 is never actually
        sent to the browser.

        Beyond that, there's little you can do to avoid a dialog box appearing
        in a particular user agent at the application level. Client-side
        Javascript simply can't do anything about the browser receiving, and
        acting on, a 404 HTTP response. However, from my testing Firefox 0.9
        does not show an "alert()" style dialog unless the host _can't be found_
        (resolved). If it receives a 404 HTTP response, it displays "The
        specified page was not found at <host>."

        Regardless, there's nothing you can do about an application level dialog
        appearing when Firefox/Mozilla can't resolve a hostname using
        client-side Javascript.

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

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


        * Internet Explorer DOM Reference available at:
        *
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


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


        Comment

        • Yvon Kephren

          #5
          Re: Page Not Found

          Thanks for the insightful string. But with that information comes the
          next useful question can I detect if the document exists on the fly. If
          not an Index will have to do.

          *** Sent via Devdex http://www.devdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Page Not Found

            Yvon Kephren wrote:[color=blue]
            > Thanks for the insightful string. But with that information comes the
            > next useful question can I detect if the document exists on the fly.[/color]

            Your well-configured Web server does this for you.


            PointedEars

            Comment

            Working...