how can I trigger an onleave event for mobile? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

how can I trigger an onleave event for mobile?

I'm trying to set up an event that triggers when the users clicks the back button on their mobile.

1st Jun 2020, 10:05 AM
Lucky victory
Lucky victory - avatar
2 Respostas
+ 2
You have to use 'backbutton' event with document. for example: document.addEvenetListener('backbutton', function() { //Code });
1st Jun 2020, 10:45 AM
Raj Chhatrala
Raj Chhatrala - avatar
0
šŸ”« Rick Grimes thanks for this.
1st Jun 2020, 11:24 AM
Lucky victory
Lucky victory - avatar