I’m running with this issue since a week now
I wonder to do something very simple :
Extract the XML content contained within an iframe and consume it within the parent document (in my case send the XML to an ActiveX for a signature)
here is a url where to find the the mini
project zip
my target browser is IE9/10.
Parent document :
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit">
<h1>Parapheur 5.0</h1>
<div class="alert-block">Please use buttons for actions</div>
<div class="btn-group">
<a class="btn btn-success btn-mini" onclick="javascript:expandViewport('viewport1');">Expand viewport »</a>
<a class="btn btn-info btn-mini" onclick="javascript:collapseViewport('viewport1');">Collapse viewport »</a>
<a class="btn btn-primary btn-mini" onclick="javascript:extractXml('#viewport1');">Extract XML »</a>
</div>
<div class="alert-block"></div>
<iframe id="viewport1" src="xml/data.xml" width="1024px" height=""></iframe>
<div class="alert-block"></div>
</div>
<div id="content" class="alert-info"></div>
application.js :
function extractXml(id,content) {
console.log("Starting extraction of XML from within IFrame : " + id);
/*
var lastIndexOfSlash = document.getElementById(id).src.lastIndexOf("/");
var doc = document.getElementById(id).src.substring(lastIndexOfSlash);
$.get('xml/'+doc,function(xml){
console.log(xml);
});
*/
console.log($(id).contentDocument);}
it seems the only way to load the xml from the iframe under IE9 is by the execution of the following line of code.