How does cross domain apply to iframes loaded using the file protocol?
I am doing some very basic html stuff by opening the file on the file system and editing it. Then I open the file using the browser to view it. I am getting some "
Error: Permission denied to access property 'ownerDocument'" messages when trying to access the iframe. So I am not sure if I am just trying to access the iframe wrong, or if because I am using the file protocol and there are some permission issues.
Here is the html I am working with:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="../org.jquery/jquery-js/jquery.js"></script>
<script type="text/javascript" src="../com.beebole.pure/pure-js/pure.js"></script>
</head>
<body>
<div>outer</div>
<div id="inner-content">inner</div>
<iframe id="account" name="account" sandbox="allow-same-origin" seamless src="../account/account.html"></iframe>
<script >
$(document).ready(function(){
$('#account').ready(function () {alert('test')});
var frameHtml = $('#account').contents().find('span')
//.text();
$('#inner-content').html(frameHtml);
});
</script>
</body>
</html>
The error comes as the result of the find function invocation. What I want to do is pull the html out of the iframe and add it into the inner-content div. I also wanted to avoid running the javascript twice so I put it into the html5 sandbox. Removing the sandox did not make the error go away.