Setting Javascript context for iFrame in iFrame

I have a page with <iframe>

and inside <iframe>

another one appears <iframe>

as a window. What I am trying to do is call the taht function set to <iframe>


.... I know a lot of the same tag is going on.

This is what I mean in HTML format.

 <iframe src="blahblah.html" name="iframe">
  //blahblah.html html
  <iframe src="blahblahpopup.html" name="iFrame2">
   //blahblahpopup.html html, also where the function is set.


So, as you can see, <iframe>

there is <iframe>


Now let's get down to business. I am using this JS code to get my JS context in the first level <iframe>

named "iframe"



What it means is it brings up a popup inside the first level <iframe>

. But now I need to call a function inside the popup that was just called. (which is another <iframe>

... I am not the cause of all <iframe>


So my unsuccessful attempt at calling a function defined at the second level <iframe>




I have also tried



Nothing works. Any help on this? I am using node-webkit to remove security restrictions <iframe>


Thanks for any help you can throw at me!

PS Good God, I've said <iframe>

too many times in this post.


source to share

2 answers

Probably the problem is that you are not waiting for the Asset Picker to load and therefore the function populateTypePullDown

has not been defined yet.

Try something like this:

    .ready(function() {
        var $innerIframe = $(this).contents().find('#iFrame2');
        console.log($innerIframe, 'ready');




Found out the answer. What I did was achieved inside the main one <iframe>

, and got the contents of the window <iframe>






All Articles