I got this problem only on IE (even on most recent versions, like 11). The thing is that I appended an iframe dinamicly to my document in which I'm writing some scripts for later execution. Those scripts must paint an image in the end, the problem is I'm getting anoying margins on IE from the body.
I can't load that using the src, it must be dynamic. So I just thought "lets get access to the iframe and write some style on the body". But when I retrieve the iframe doc like this...
var win = (iframe.contentWindow) ? iframe.contentWindow : (iframe.contentDocument.document) ? iframe.contentDocument.document : iframe.contentDocument;
... win.document.body
or win.document.querySelector("body")
returns null (again, in ie 11).
Does anyone know how to get to the body safely?