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

  • SEARCH
  • Home
  • 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 6201801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:37:14+00:00 2026-05-24T04:37:14+00:00

Example — begin: index.html — <!doctype html> <html> <head> <title>Index</title> <script type=text/javascript src=mootools.js></script> </head>

  • 0

Example

— begin: index.html —
<!doctype html>
<html>
<head>
<title>Index</title>
<script type="text/javascript" src="mootools.js"></script>
</head>
<body>
<iframe src="iframe.html" id="innerFrame">blah</iframe>
</body>
</html>
— end: index.html —

— begin: iframe.html —
<!doctype html>
<html>
<head>
<title>iFrame</title>
</head>
<body>
<form>
<input id="inputField" type="text" value="this is text." />
</form>
<script type="text/javascript">
$('inputField').set('value', 'updated text');
</script>
</body>
</html>
— end: iframe.html —

Currently, $(‘inputField’).set(‘value’, ‘updated text’); doesn’t work :-\

  • 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-24T04:37:14+00:00Added an answer on May 24, 2026 at 4:37 am

    My previous answer offered two alternative ways of doing the task in question (“load Mootools in a parent frame and then re-use it in iframes”). The first method didn’t “re-use” the Mootools functionality loaded into the parent frame, but was rather an alternative way to load the script in the inner iframe. The second method was just a hacky way of copying over the script by putting the entire mootools core source inline in a script element and then copying that element’s content into a script element in the iframe’s head (hardly optimal).

    This following method does programatically extend the window and document objects of the inner iframe. Again, it is assumed that both the parent page and the iframe are on the same domain.

    In my (brief and simple) testing, loading the source in both parent and iframe resulted in 72.1 KB transferred at around 130ms (to finish loading both the parent and iframe pages), while the page that loaded the source and then extended the iframe was 36.8 KB and took around 85ms to load both parent and iframe. (that’s with gzip on the server…file size of uncompressed/unminified core source is around 134 kb).

    For this method a few trivial additions/edits are made to the mootools core source. Download an uncompressed version of mootools-core-1.3.2.js, and rename it to ‘mootools-core-init.js’ (or whatever). The following steps assume that you checked all boxes on the core builder page except ‘Include Compatibility’.

    Add this to the top of the ‘mootools-core-init.js’ file (above the first self-calling anonymous function):

    var initMootoolsCore = function(){
    
    var window = this;
    var document = this.document;
    

    Add this to the very bottom of the core js file:

    };
    
    initMootoolsCore.call(window);
    

    Do the following find/replace tasks:

    1

    • Find:})();
    • Replace: }).call(this);

    2

    • Find: if (Browser.Element) Element.prototype = Browser.Element.prototype;
    • Replace: if (this.Browser.Element) Element.prototype = this.Browser.Element.prototype;

    3

    • Find: var IFrame = new Type
    • Replace: var IFrame = this.IFrame = new Type

    4

    • Find: var Cookie = new Class
    • Replace: var Cookie = this.Cookie = new Class

    (download | compressed version)

    In your parent index.html file, put the following script element in the head

    <script type="text/javascript" src="mootools-core-init.js"></script>
    

    Finally, in your iframe.html file, put the following inline script element in the head to extend the iframe’s window and document (it must be before any included or inline scripts that need to use Mootools):

    <script type="text/javascript">parent.initMootoolsCore.call(window);</script> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.