0

I have a javascript variable with a full html code (html, head, body), not just body content. Now I need to render that code into another html page.

An iframe without src works great loading the code via jquery:

$("#myIframe").contents().find('html').html(myJsVar);

But I cant catch the keyup event in that iframe and that is mandatory.

My desired solution is to use an div that can render the page, but i think that it is impossible :(

Do you have any other idea?

Very much thanks!

Masta
  • 149
  • 4
  • 15
  • Have you perused existing answers like http://stackoverflow.com/a/1933220/30007 or http://stackoverflow.com/a/4914914/30007 or http://stackoverflow.com/a/10942878/30007 ... Try searching a bit on SO. – Amith George Jul 21 '12 at 15:45

1 Answers1

0

This seems pretty straightforward: jsFiddle example

$('#myIframe').contents().find('#myInput').keyup(function() {$(this).val('new value');});​
Nate Barr
  • 4,640
  • 2
  • 25
  • 21