I'm having a lot of trouble figuring out how I can access content in an iframe in Air. Here is a sample jquery code that I tested with.
$(document).ready(function(){
$("#frame").ready(function(){
air.trace($("#frame").contents().find("body").html());
air.trace(window.frames["frame"].innerHTML);
air.trace(document.getElementById("frame").innerHTML);
});
});
I am using iframe.
<iframe src="http://google.com" id="frame" width="100%" sandboxRoot="http://google.com/" documentRoot="/" name="frame" height="600"></iframe>
Exit from above code
null
undefined
As you can see, the content is always null, undefined, or an empty string. Am I missing something that is stopping me from accessing iframe content? Any suggestions would be appreciated.
source
share