1

Please forgive my poor use of the correct terminology here!

I have a page with nested iframe where I use jquery to traverse through to it - I can pull any element from the iframe and perform jquery functions on it.

Within the iframe's page, is a javascript variable. How can I access this variable?

cheers :)

Tabloo Quijico
  • 700
  • 2
  • 10
  • 26
  • 1
    Does the content of the iframe come from the same domain as that of the container page? – Salman A Apr 07 '11 at 09:07
  • not exacly what you are looking for - but close: http://stackoverflow.com/questions/4689145/pass-jquery-variables-between-iframe-and-parent – Billy Moon Apr 07 '11 at 09:08

2 Answers2

2

If your iframes are hosted on the same domain you can access them from the window.frames array. Something so:

window.frames['myframename'].document.some_variable
Jake
  • 2,471
  • 15
  • 24
0

See: Invoking JavaScript code in an iframe from the parent page

Community
  • 1
  • 1
neebz
  • 11,465
  • 7
  • 47
  • 64
  • perfect, cheers.. (and thanks to everyone else for the other responses).. I guess wanting to do the 'finding' through jQuery was a bit unnecessary. – Tabloo Quijico Apr 07 '11 at 09:38