0

When I try to set an iframe to a blank, black screen, I get an "access denied" error in IE11 and my app freezes. I don't get this error in firefox, chrome, or opera. My code is:

iframe1.src = "about:blank";

I have also tried:

src="javascript: ;"

and

src="javascript:void(0)"

I also tried creating a blank html page to use as a src, but that didn't work either.

Edit: I figured out what the problem was. In my code, I replaced:

iframe1.src = "about:blank";

with:

document.getElementById("iframe1").src = "about:blank";
user3080392
  • 1,194
  • 5
  • 18
  • 35
  • possible duplicate of [Is an empty iframe src valid?](http://stackoverflow.com/questions/5946607/is-an-empty-iframe-src-valid) – metadings Feb 10 '15 at 10:25
  • @metadings It's not a duplicate because all of those answers suggest the use of "about:blank" As I stated in my question, "about:blank" doesn't work. – user3080392 Feb 10 '15 at 10:55
  • How exactly you put the value to `iframe1`? Using `frames` collection? If so, please see [this answer](http://stackoverflow.com/a/28155232/1169519). – Teemu Feb 10 '15 at 12:09
  • Well it's weird that you get an access denied error... Please post some code, how you create that `iframe`! – metadings Feb 10 '15 at 21:48

0 Answers0