iPad Safari IOS 5 window.close() closing wrong window

前端 未结 3 1399
傲寒
傲寒 2021-01-12 02:23

We have an iPad application that\'s working on our older iPads.

We open external links using var x = window.open(url)

at the end of the day, when the user cl

3条回答
  •  无人及你
    2021-01-12 02:57

    I had the same issue as well. My initial code would focus on the parent window and then close the current one. This always ends up closing the wrong window. What I did was to remove the .focus call and added a small delay to the window.close() and it worked for me. Original source for the delay suggestion - https://twitter.com/#!/gryzzly/statuses/177061204114685952

提交回复
热议问题