returnValue is an IE specific feature - what if you just do:
$(window).bind("beforeunload"), function(){
return "Quit without saving?";
});
However, the problem is much larger than that - the beforeunload event ONLY works if you directly access the window object and do:
window.onbeforeunload = function(){ ... };
For example, opening a browser and doing:
window.addEventListener('beforeunload',function(){
return "test";
});
You'll find that it doesn't work, so we won't be able to do anything to help the situation. (So in this case, I recommend that you fall back to the traditional way of doing things.)