0

I am loading external javascript code to iframe with

<iframe id="myframe" src="http://external.tld/code"></iframe>

output from "external.tld/code" is:

var myvar="";
function something(){}

now I need to get this code as a plaintext to javascript variable in my main window. How? I tried document.getElementById('myframe').contentWindow.document.body.innerHTML but is is not working.

peter
  • 4,289
  • 12
  • 44
  • 67

0 Answers0