Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Posted on Mar 21, 2012 10:02 AM

Reply

There are no replies.

ios 5.1 Window.close() does not work

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.