Hi,
i'm trying to lock a row in a db-table when a user is editing the entry.
So there's a field in the table lock
that I set 1 on page load with php.
Then I was trying to unlock the entry (set it 0) when the page is unloaded. This is my approach. It works fine in IE but not in Firefox, Chrome etc.... The window.onbeforeunload works in all browsers, I tested that. They just don't do the Request BUT if I simple put an alert after req.send(); it works in some browsers but not safari or chrome. So I tried putting something else after it just so that's there's other stuff to do after the request but it doesn't work.
function test() { var req = new Request({ url: 'inc/ajax/unlock_table.php?unlock_table=regswimmer&unlock_id=', }); req.send(); alert('bla'); // ONLY WORKS WITH THIS !?!?!? }
window.onbeforeunload = test;
i've already tried different ways to do the request but nothing seems to work. And the request itself works, just not in this constellation.
ANY help would be appreciated!
Thanks