shadedecho
Programmer
I've been banging my head on this topic all day.
I want to have an iframe load a url which will return nothing but json. And the url will be same domain, so no cross-domain issues. And I want to then access that json from parent document. I've tried several dozen variations of this, to no success thus far:
There has to be a good cross-browser way to access the contents of an iframe if it's not a standard HTML file, right? How do I do it?
I want to have an iframe load a url which will return nothing but json. And the url will be same domain, so no cross-domain issues. And I want to then access that json from parent document. I've tried several dozen variations of this, to no success thus far:
Code:
var iframe = document.getElementById("myiframe");
var iwin = iframe.contentWindow || iframe;
var doc = iwin.document;
alert(doc.innerHTML);
There has to be a good cross-browser way to access the contents of an iframe if it's not a standard HTML file, right? How do I do it?