Window Open in IE not working

Can someone help me understand why this link works fine in firefox, but popup doesn't work in IE?

<a href="javascript:void window.open('/assets/flash/sage200demo.html', 'Sage 200 Demo', 'width=1024,height=768,status=0,resizable=0')"> 

+4
source share
2 answers

The spaces in the second argument to window.open cause the problem. This argument is the name of the window, and IE doesn't like it if it has spaces. This will work:

 <a href="javascript:void window.open('/assets/flash/sage200demo.html', 'Sage200Demo', 'width=1024,height=768,status=0,resizable=0');"> 

Working demo: http://jsfiddle.net/Lx4sQ/

+6
source

Try changing it to the following:

 <a href="javascript:window.open('/assets/flash/sage200demo.html', 'Sage200Demo', 'width=1024,height=768,status=0,resizable=0');return false;"> 

or better yet

 <a href="#" onclick="window.open('/assets/flash/sage200demo.html', 'Sage200Demo', 'width=1024,height=768,status=0,resizable=0');return false;"> 

or better yet

 <script> function openWindow(e) { e.preventDefault(); window.open('/assets/flash/sage200demo.html', 'Sage200Demo', 'width=1024,height=768,status=0,resizable=0'); } </script> <a href="#" onclick="openWindow(event);"> 
+2
source

Source: https://habr.com/ru/post/1335979/


All Articles