Access Denied error in IE6 when try to access to a IFRAME without src

  • Thread starter Diego Fernández Santos
  • Start date
D

Diego Fernández Santos

Access Denied error in IE6 when try to access to a IFRAME without src
This problem only happens in IE6, in Firefox it works well. It happens
when I change the document domain and then try to access to an
existing IFRAME, without src attribute.

How can I specify the iframe content of a IFRAME without src if the
parent can not access to it?

To see the error you have to put the next document in a web server
with the domain "www.microsoft.com", you can create a new entry in the
hosts file.

<html>
<head>
<script type="text/javascript">
document.domain = "microsoft.com";
</script>
</head>
<body>
<iframe id="myFrame"></iframe>

<script type="text/javascript">
window.onload = function() {
var f = document.getElementById('myFrame');
f.contentWindow.document.body.innerHTML = "Perfect!";
}
</script>
</body>
</html>
 
W

wilq

Access Denied error in IE6 when try to access to a IFRAME without src
This problem only happens in IE6, in Firefox it works well. It happens
when I change the document domain and then try to access to an
existing IFRAME, without src attribute.

How can I specify the iframe content of a IFRAME without src if the
parent can not access to it?

To see the error you have to put the next document in a web server
with the domain "www.microsoft.com", you can create a new entry in the
hosts file.

<html>
<head>
  <script type="text/javascript">
    document.domain = "microsoft.com";
  </script>
</head>
<body>
  <iframe id="myFrame"></iframe>

  <script type="text/javascript">
    window.onload = function() {
      var f = document.getElementById('myFrame');
      f.contentWindow.document.body.innerHTML = "Perfect!";
    }
  </script>
</body>
</html>

Did you try setting src="" ???
 
V

VK

Access Denied error in IE6 when try to access to a IFRAME without src

Of course not. (i)frame has to have valid src attribute to assign the
appropriate domain and security zone to it. With your hacking attempt
to use src'less (i)frame as a cross-domain interaction buffer you are
late for 11 years at least: long time discovered and fixed. Happy
further attempts :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top