The javascript/html below creates a small popup window to the bottom right of the users screen. This code works on Chrome and Firefox but not on IE v9 for some reason.
In the IE9 debugger it says
Line: 17
Error: Invalid argument.
line 17 being the line starting var win = window.open(…
In the debugger I see:
HTML1202: http://xyzserver:8080/path/test_popup.html is running in Compatibility View because 'Display intranet sites in Compatibility View' is checked.
and
SCRIPT87: Invalid argument.
test_popup.html, line 17 character 3
character being the v in var win = …
Anyone any ideas?
<!DOCTYPE html>
<html>
<head>
<script>
function open_win(data)
{
var w = 200;
var h = 200;
var left = (screen.width - (w * 1.1));
var top = (screen.height - (h * 1.1));
var win = window.open('', 'about:blank', 'width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
win.document.write("<p>Received: " + data + "</p>")
win.focus()
}
</script>
</head>
<body>
<form>
<input type="button" value="Open Window" onclick="open_win('information here')">
</form>
</body>
</html>
try this:
so without
'about:blank'because Microsoft does not support a name as second argument.or you should say:
window.open('_blank', '', 'width='...)....etcgiving the name as a first argument.