<body onbeforeunload='cancelOrder();'> cancelOrder()为页面离开调用的事件 转载于:https://www.cnblogs.com/pumushan/p/9295258.html