Results 1 to 2 of 2

Thread: setting window.onerror for IFRAME

  1. #1
    Join Date
    Aug 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default setting window.onerror for IFRAME

    I am trying to set an error handler for an IFRAME's contents to the error handler defined on the parent document...

    window.onerror = myError;

    for (frame=0; frame < document.frames.length; frame++)
    {
    document.frames[frame].onerror = myError;
    }

    but it seems that when i set the onerror, JavaScript is interpreting this as a dynamic property and assiging the string representation (the function) of the function myError and not setting it as an event handler. i have seen documentation state that the frames collection of the document "retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window".

    is this possible to do in JavaScript? thanks for your help!

    Sunish

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    document.frames doesn't exist - at least in Firefox, which is DOM-compliant. This may be your problem.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •