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!

1

1 Answer 1

0

This seems pretty straightforward: jsFiddle example

$('#myIframe').contents().find('#myInput').keyup(function() {$(this).val('new value');});​
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.