@author Steponas Kazakevičius <stepas@itworks.lt>
    @url http://itworks.lt/blog/

This page demonstrates the ability to stop user download when he/she leaves this page. Click "Download" and try closing this page. Or clicking "stop the callbacks".

After you finish or cancel the download, the Download button will be active again and you can repeat the download.

Once downloaded or cancelled, you can see the source of the downloaded file. The result - "download complete" or "you left the page" will be at the end of the file

PS: the download is random string data, capped @ 4kB/s. It goes for 30 seconds.

For more info, see or download the source.