Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 950227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:31:54+00:00 2026-05-15T23:31:54+00:00

I already have a set of functions I use to extend the document (i.e.

  • 0

I already have a set of functions I use to extend the document (i.e. bind/unbind). So I can do stuff like: document.bind('load',someAction,{})

But it doesn’t work if I do: $('some_iframe').contentWindow.document.bind(...)
And apparently, $('some_iframe').contentWindow.document.prototype doesn’t exist.

EDIT:
Here is the code breakdown:

//the eggplant library
eggp = {
    extend: function(dest, source){
        for(var prop in source)
            dest.prototype[prop] = source[prop];
        return dest;
    },
    //other functions below...  
    bind{},  
    unbind{}
}
//extend the DOM
eggp.extend(Document, eggp);
//extending the iframe document DOESN'T WORK
eggp.extend(someiframe.contentWindow.document, eggp);

I’ve checked to see if someiframe.contentWindow.document is undefined, but it returns object HTMLDocument

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:31:55+00:00Added an answer on May 15, 2026 at 11:31 pm

    You can’t do this, at least not in a cross-browser way. Ideally you would extend the prototype of the HTMLDocument object, but of course, IE does not have this object in the first place. As a workaround, you could create a function that creates an IFrame and automatically extends its document object, and exclusively use that function to create your IFrames, but if the frames are already on the page, there isn’t much you can do about it short of looping through each one and extending it manually.

    $('iframe').each(function() {
        MyLibrary.extend(this.contentWindow.document, MyDocumentPrototype);
    });
    

    (Assuming jQuery, insert your own library code to get all IFrames here.)

    In general, though, extending built-in DOM objects is a bad idea, so you should come up with another way to do what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already posted something similar here but I would like to ask the
I already have a deploy.rb that can deploy my app on my production server.
We already have things like static analysis that tells us what's wrong with our
Can anyone recommend monitoring software for a windows environment? We already have monitoring in
The basics have already been answered here . But is there a pre-built PHP
I have written a set of javascript functions that allow me to validate user
I want to assign a resource I already have a second name, similar to
What alternatives are there to GAE, given that I already have a good bit
For statistical reasons, I want an extensive analysis from a dataset. I already have
I have already tried PreRenderComplete and unload is too late

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.