只监听用户用F5刷新
检测F5的keypress keydown等事件,检测是否被摁下
参考:https://segmentfault.com/q/1010000004411039
http://www.open-open.com/lib/view/open1418548024667.html
检测F5的keypress keydown等事件,检测是否被摁下
Ext.get(document).on('keydown',function(e){
var iframeSrc = window.location.href;
if(e.keyCode == 116){
e.preventDefault(); //阻止默认刷新
window.location.href = iframeSrc;
}
});
参考:https://segmentfault.com/q/1010000004411039
http://www.open-open.com/lib/view/open1418548024667.html