0

I currently have a web page which when a user types something into a text box it automatically updates the same text in a DIV on that page. Using the code below;

<script>
  $(document).ready(function () {
    $('#someTextBox').keyup(function(){
      $('#form').html($(this).val());
    });
   });
</script>

I currently EMBED another web page within the HTML page and was wondering weather I could dynamically change a DIV within this EMBEDED page from the text box on the container page?

So when a user types something into the text box it updates the #form DIV on the embed page?

I'm not sure if this is possible but wanted to ask.

Thanks

Luke14
  • 106
  • 2
  • 15
  • Depends largely on what “embedding” means. – CBroe Mar 23 '14 at 16:02
  • ` Error: Embedded data could not be displayed. ` – Luke14 Mar 23 '14 at 16:06
  • And is that embedded page from the same domain? Otherwise the Same origin Policy will stop you right there. – CBroe Mar 23 '14 at 16:08
  • Yes it is just another page in the same directory – Luke14 Mar 23 '14 at 16:17
  • Well using an `iframe` to embed the other document would allow for easier access to it … with `object` that’s a bit of a hassle. The `contentDocument` property of the `iframe` element refers to the document object of the page loaded into the iframe, so it’s quite easy to go from there. – CBroe Mar 23 '14 at 16:19
  • so if i change the embed to an `iframe` can the javascript refer to `DIVS` within that embded page? – Luke14 Mar 23 '14 at 16:23
  • http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe – CBroe Mar 23 '14 at 16:25

0 Answers0