How to access into iframe:
var iframe = document.getElementById('sitefield1');
var innerDoc = iframe.contentDocument || iframe.contentWindow.document;
var elem = innerDoc.getElementsByClassName("myclass")[0];
Main page is test1.ru, iframe is test2.ru (both on my computer). In .htaccess is
Header add Access-Control-Allow-Origin "http://test1.ru/2"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
Header add Access-Control-Expose-Headers "X-InlineCount"
Is it possible to get inside the iframe module?
I am owner of this web sites (do some testing) and can also add any settings to my firefox.
What I found also that this code do not work in IE (even that I turn on acceess beween different domains and XSS filter is turned off). Chrome looks like do not support --disable-web-security anymore... Chrome's error is
Blocked a frame with origin "test1" from accessing a frame with origin "test2". Protocols, domains, and ports must match.
Any ideas will be very helpful to do this.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…