Окно DOM разгружает событие, действительно ли это надежно?

scala> for(x <- List(1,2,3,4)) println(x + 1)
2
3
4
5
18
задан tshepang 16 May 2014 в 19:08
поделиться

2 ответа

You will likely want to use the "onbeforeunload" event too, it provides more control than the "onunload" event.

That said, be aware that: Opera doesn’t fire the unload event when the browser refreshes the page, or uses the back/forward buttons to browse off of the page. What’s worse, Opera never fires the onbeforeunload event. Thus if you are supporting Opera - be aware of these issues.

10
ответ дан 30 November 2019 в 09:18
поделиться

Не при всех обстоятельствах нет. Браузер может дать сбой и т. Д., Не давая событию сработать. Пользователь также может использовать надстройки, такие как Grease Monkey, чтобы предотвратить запуск события.

5
ответ дан 30 November 2019 в 09:18
поделиться
Другие вопросы по тегам:

Похожие вопросы: