ios 5.1 Window.close() does not work
After my iPad 1 got the iOS 5.1 update, Calls to Window.close() are now closing the wrong window. In the following code snippet, when 'close window' is clicked, it will close the current window, instead of the google window:
<html>
<head>
<script type="text/javascript">
function openWin() {
winRef = window.open("http://www.google.com", "", "width=" + screen.width + ",height=" + screen.height + ", top=0, left=0, scrollbars=1, resizable=yes");
}
function closeWin() {
winRef.close();
}
</script>
</head>
<body>
<input type="button" onclick="openWin()" value="open window"/>
<input type="button" onclick="closeWin()" value="close window"/>
</body>
</html>
I have tried using different window.open() parameters, but the bug remains. If I call winRef.focus(), it will focus the correct window. So, it's only a problem with close(). I believe this is an ios 5 bug. Does anyone have any ideas or advice? Has anyone seen this before?
iPad, iOS 5.1