detecting 404 error in an iframe

Discussion in 'JavaScript' started by fuhrmann, May 15, 2007.

  1. #1
    I have a web page on an intranet that uses an iframe to display a web page that exists on a users drive.
    The code to display the frame is:
    <iframe width=594 height=300 marginwidth=0 marginheight=0 frameborder=0
    src="file:///u|\mywebpage.htm">You should never see this, contact Bill.
    </iframe>

    Is there a way to set up a javascript (on the main web page) that can recognize if there is a 404 error and redirect the user to a page that explains how to create the file on their directory?

    There are too many people involved for me to create all of the files and most of them never would need it.
     
    fuhrmann, May 15, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    Instead of using an iframe, IMO it would be better with AJAX, so if your ajax update fails, you can fill/redirect with/to that explanation page.
     
    ajsa52, May 15, 2007 IP
  3. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you have enough access to be able to create your own 404 error page? That would be able to do the trick.
     
    rgchris, May 15, 2007 IP