Sunday, November 1, 2009

[jQuery] jquery ajax and listening for users exiting the site

I want to send data to a remote site but only after the customer leaves. Its
not working and I just want to make sure I am not doing anything wrong. can
anyone see anything wrong with the collowing code

$(window).bind('beforeunload', function()
{
$.post('http://myWebsite.com/usersessions/store', {data:
this.exportJSON()});

});
--
View this message in context: http://old.nabble.com/jquery-ajax-and-listening-for-users-exiting-the-site-tp26155435s27240p26155435.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

No comments: