New issue 60915 by hareshvidja: AJAX call not works on onBeforeUnload event
http://code.google.com/p/chromium/issues/detail?id=60915
Chrome Version : 6.0.472.62 (59676) Ubuntu 10.04
URLs (if applicable) :
Other browsers tested:
Safari 4: NOT TESTED
Firefox 3.x: OK
IE 7: OK
IE 8: OK
What steps will reproduce the problem?
1. AJAX call not works on onbeforeUnload event
2. alert box works properly on beforeunload
I want clear User login session when it click on back/refresh button or
redirect by changes on URL in online system. I have implemented clear
server side session using JavaScript for this by calling ajax
onBeforeUnload event.
Instead of my expectation it not clearing a user session after redirecting
a page. For testing purpose i have put alert box it displays as per my
expectations BUT after closing alert box it redirects a page but not clear
a server side session. It works fine in all other browsers as per my
expectations.
Please help me for this..
Thanks
Please help me for this error.....
Please tell me if have any alternative solution for this
I am waiting for anyone's comment
hehehehe :( :'(
You meet problem like I did..... but Ajax will works if:
( I don't want message alert but if no message alert, it will not work )
( This for IE but Chrome and Firefox work well if no message)
$(document).ready(function(){
window.onbeforeunload = function(){
logout();
return 'any string';
}
function logout(){
$.ajax({});
}
});