164
rated 0 times
[
170]
[
6]
/ answers: 1 / hits: 15956
/ 11 Years ago, wed, april 3, 2013, 12:00:00
Some websites have focus
set on an element on window load. If I iframe that website, It seems not able to set focus on parent window, programmatically. This only happens to IE
(9) and Firefox
(19), Opera/Safari/Chrome are fine.
<script>
window.onload = function() {
setTimeout(function() {
// this does not focus #foo
document.getElementById(foo).focus();
// or more seconds that enough to see the iframe focus
}, 3000);
};
</script>
<input id=foo type=text value=foo /><br />
<iframe width=800 height=500 src=http://www.bing.com />
Does anyone know a workaround for this problem?
More From » internet-explorer