Some functions not working on Safari unload

Some functions not working on Safari unload


I am developing a very simple tracking script. Whenever a visitor
exits the page, the script pings a PHP script on a remote server.
Here is the code I am currently using: http://pastebin.com/m63160ac
This is working as desired in FF, IE, and Opera. Safari will perform
the 'alert' in the unload event, but not draw the image. I have also
tried to use $.getJSON instead of Image().src, but it resulted in the
same issue. I am baffled as to why this is occurring.
Any help would be appreciated. Thank you.