javascript - Onunload, onbeforeunload - guidance requested -


i have web server generates questions students of particular subject. web server needs keep track of how time each student has spent on particular set of questions.

the web pages have "finished" button, which, when pressed, causes statistics sent server.

however, want web browser send statistics if student navigates away page or closes browser window without pressing "finished".

for purpose, have planned have "onunload" or "onbeforeunload" send ajax request server relevant information. apparently different browsers not support these events, , there restrictions on can done in event handlers. and, of course, don't want browse freeze if communication server fails.

so, need advice on best way this.

if wanted sure handle "special events" send tick 'requests' webpage server. granularity depends on tracking requirements, load, , whether intranet or internet application; can seconds or minute. tracking time spent on page if browser/os/network crashes.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -