1

this problem is solved here: Pass jquery variables between iframe and parent

Anyway, this wont work on opera. It's fine on firefox, but opera gives me this error:

Uncaught exception: ReferenceError: Security error: attempted to read protected variable

I need to pass variables between iframe and parent and it's enough for me if this works only in recent major browsers releases.

Community
  • 1
  • 1
Giedrius
  • 1,590
  • 3
  • 16
  • 27
  • If both the iframe and the parent page reside in the same domain then talking between the two can be done bottom-up by calling parent.functionName() within the child. Otherwise you will not have visibility. – MoarCodePlz Jun 23 '11 at 02:30
  • Yes, iframe and parent is in the same domain, and parent.functionName() not working on Opera, same error, but work fine with firefox5 and chrome. – Giedrius Jun 23 '11 at 11:20
  • Currently im working on localhost and this part of url address are the same: http://127.0.0.1/www/cms/admin/ – Giedrius Jun 23 '11 at 11:35
  • **This is in the iframe:** `$('#close').click(function(){ parent.iframeCatch(); })` **And this is in the parent:** `function iframeCatch() { $('iframe#media').animate({'opacity':'0'}, 500, function() { $(this).detach(); }); console.log('Ok, I\'m officially On now!') }` – Giedrius Jun 23 '11 at 21:03
  • Unfortunately I just noticed that my tiny MCE editor stopped working properly in Opera too. Opera loads the editor, but not allowed to select textarea and write something. I got error similar to what I get from iframe: `Uncaught exception: ReferenceError: Security error: attempted to read protected variable: open` In other browsers like firefox or chrome everything works fine. Is there is some bug with opera and iframes? – Giedrius Jun 24 '11 at 12:49
  • possible duplicate of [Pass jquery variables between iframe and parent](http://stackoverflow.com/questions/4689145/pass-jquery-variables-between-iframe-and-parent) – Brian Tompsett - 汤莱恩 Feb 06 '15 at 23:30

0 Answers0