Yes, beforeunload is more reliable, but be sure to assign it directly (not bound through jQuery), like this:
確定! 回上一頁