В Internet Explorer, когда я нажимаю ссылку во второй раз, окно уже открыто, но оно не сфокусировано. Он отлично работает в Chrome и Firefox. С помощью следующего кода:
Internert Explorer window.open не фокусируется после первого щелчка
function open_page(url, name, features) {
var win = open(url, (name == null ? 'page' : name), (features == null ? 'menubar=1,toolbar=1,scrollbars=1,width=1024,height=768,resizable=1' : features));
if (win == null) {
alert('Can not open');
} else {
document.isUnloading = false;
win.focus();
}
}
<input type="image" id="pdf" name="pdf" style="padding: 2px; background-color: white; border: 1px dotted white;" title="PDF" src="/images/buttons/pdf.png" alt="PDF" onclick="open_page('http://www.w3schools.com'); return false;" onmouseover="document.getElementById('pdf').style.border='1px solid #a0a0ff'; document.getElementById('pdf').style.backgroundColor='#f0f0ff';"
onmouseout="document.getElementById('pdf').style.border='1px dotted white'; document.getElementById('pdf').style.backgroundColor='white';">
Вы не единственный, кто спрашивает: http://stackoverflow.com/questions/27898232/function-window-focus-doesnt-work-in-ie-8-9-10-11 - на что я ответил несколько много лет назад. – mplungjan