This question already has answers here:
How to detect online/offline event cross-browser?
(15 answers)
Closed 8 years ago.
I was wondering how I could run js if the user goes offline during the time that they are on my site.
What I'm planning on doing is notifying them so they know and can reconnect?
I was using offline.js, here: http://github.hubspot.com/offline/docs/welcome/, but that is too complex for what i'm building honestly.
Listen for offline events on window:
window.addEventListener('offline', offlineHandler);
or if you want it more jQueryish,
$(document).on('offline', offlineHandler);
Related
This question already has answers here:
How to detect a mobile device using jQuery
(66 answers)
Closed 4 years ago.
For example when someone visit my website he see a page for downloading an app
Use navigator.platform to get the platform of the browser. According to it open different pages.
This question already has answers here:
Prevent user to perform any actions while page is loading
(4 answers)
Closed 6 years ago.
I need to disallow interaction with an asp.net form during its processing.
In my opinion I should use a javascript event for this but I'm a little bit confused about which one to use.
Use a javascript plugin like BlockUi to place an overlay on the page until all requests have completed and the page is fully initialised.
This question already has answers here:
How to Detect Browser Window /Tab Close Event?
(8 answers)
Closed 7 years ago.
I know about window.onbeforeunload, but that also executes when the user clicks on a link or refreshes the page, while I want my function to only execute when the browser or tab is closed. Is there a way to do that?
AFAIK the only options are unload and onbeforeunload so I would say the answer to your questions is "no".
https://developer.mozilla.org/en-US/docs/Web/Events/unload
This question already has answers here:
Use Browser Search (Ctrl+F) through a button in website?
(3 answers)
Closed 9 years ago.
Does javascript allow for to trigger a "find" action with a keyword on the current page?
No, there's no cross-browser way to do this. (I don't even know of one browser that exposes that functionality.)
This question already has answers here:
How to find event listeners on a DOM node in JavaScript or in debugging?
(20 answers)
Closed 9 years ago.
My problem is that every time I press "esc" button on my site it refreshed the page to the base root (without me even requesting it to happen). I have no idea what causes that and which event of keyup/keydown is registered.
My question is:
How can I see what events are currently registered on my site so I can track this issue?
Check Visual Event
It enables you to see the events that are registered on various elements of your page.