Is there a way, using JavaScript or jQuery, to detect when someone goes back to your page after opening a new window or tab?
I want to create a script that opens a new window or tab, and then does something when the user comes back to the page.
Thanks,
yes, there is. Using jQuery:
edit 1
Using
alert()was not the best idea there :p Changed toconsole.log()for demonstration.edit 2
binding to
documentdoes not work crossbrowser, changed towindow