0

I need to control jQuery codes in iframe content, is that possible?

For example, Ihave a website like www.example.com, and this site has an iframe like:

<iframe src="http://www.example2.com/test.php" frameborder="0" width="100%" height="550"></iframe>

I want to add jQuery codes in the iframe (i mean test.php) and control my main page (www.example.com). Can someone help me with that?

MJH
  • 2,301
  • 7
  • 18
  • 20
  • might be a repeat question: http://stackoverflow.com/questions/1654017/how-to-expose-iframes-dom-using-jquery I haven't yet tried it but you could try this with custom query callbacks such as `$('body').trigger('customcallbackname');` from within the iframe and in example.com you'd have a function looking at the iframe body using jquery `.on`. – Sam0 Jan 14 '17 at 21:03
  • 2
    Possible duplicate of [inject a javascript function into an Iframe](http://stackoverflow.com/questions/16194398/inject-a-javascript-function-into-an-iframe) – akousmata Jan 15 '17 at 00:47

0 Answers0