1

I need to use as a selector an element from DOM inside an iFrame.

Thanx in advance.

Reporter
  • 3,897
  • 5
  • 33
  • 47
bernie cc
  • 11
  • 1
  • possible duplicate of [jquery/javascript: accessing contents of an iframe](http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe) – Aaron Digulla Nov 02 '11 at 09:58

1 Answers1

0

You can not access anything in an iframe with JavaScript running outside this frame.

Browsers has a same origin policy to prevent security problems like phishing

(If you host the content of this iframe your self you may have a look at jQuery load() to load HTML chunks into your page)

  • The iframe has been dinamically created from my code, therefore I have full access to its elements. – bernie cc Nov 02 '11 at 10:17
  • ok, maybe you should try to load it with jQuery load(), then the html is injected into your page instead if iframe –  Nov 02 '11 at 10:19
  • The contents of the iframe is not the problem because it's added dinamically as well. I'd like to use delegate using an element into an iframe as a selector, but i don't know the syntax of the selector for this case. – bernie cc Nov 02 '11 at 11:13