There is a web page with an iframe inside. Sometimes, Input text box controls, inside the iframe, are locked/ freezed. Users cannot enter text into them. But the text box ca
Simple solution with Javascript which works for me and I saw no side effects in other browsers:
<script>
var pswElement = document.getElementById("password");
pswElement.addEventListener("focus", myFocusFunction, true);
function myFocusFunction() {
document.getElementById("password").select();
}
</script>
Anyway is quite sad MS is not able fix such problem in higher version too.
I originally wrote the plugin below to address memory leaks in IE 8, but consequently it also fixes this problem.
https://github.com/steelheaddigital/jquery.purgeFrame
This bug is very annoying, even worse there was very few informations we could find on google.
There is only one link from Microsoft that about IE9, but problem still exists in IE10 / IE11 and much easier to reproduce.
I have just create a fiddle to describe this problem
http://jsfiddle.net/WilliamLeung/T3JP9/1/
Why it is so hard for M$ to fix this issue for years?
there should be three workarounds
or schedule a "do nothing" time consuming task, which may make IE response to mouse event magically, I could not tell you why, maybe M$ could
The sample codes which setup a time consuming task
setInterval(function () {
var loopCount = 10000;
var x = 0;
for (var i = 0; i < loopCount; i++) {
x = (x + Math.random() * 1000) >>> 0;
}
return x;
}, 1000);
or reset the DOM content before remove it from document
someDivWithIframe.innerHTML = "";
$(someDivWithIframe).remove();
I am not sure if it helps for all cases, you should have a tried
The solution with jQuery worked on IE11 for me, not the other solutions.
$(theIframeElement).empty().remove();
An other solution working on IE9/10 was to set the iframe src to empty before deleting it
iframe.src=""
But this cause an exception "Access denied" on IE11 if you are using an older jQuery version < 1.11.1
Some links: For information, jQuery also fixed this Issue for it's Dialog.js plugin that was displaying content in an iframe: http://bugs.jqueryui.com/ticket/9122
jQuery bug fix to IE11 "access denied" error: http://bugs.jquery.com/ticket/14535
I had the same issue with IE11, angularjs and using an IFrame.
My template uses ng-switch
to change view-modes.
One of the view-modes contains an IFrame.
The moment I switch away from the view-mode containing the IFrame:
var iFrame = <HTMLIFrameElement>document.getElementById("myIFrame");
iFrame.focus();
this.mode = ViewModes.ModeWithoutIFrame;
Solved the problem for me.