js 如何判断是F5刷新还是点击提交刷新

如题所述

第1个回答  2017-05-01
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><script type="text/javascript">function f1(){    alert('你好');}function f2(){    alert('你不好');}</script></head><body onkeydown='if(event.keyCode==116){cu.click()}'><button id=cu onclick='f1()'>submit</button><a href="javascript:;" onclick="f2();">换一个</a></body></html>

本回答被网友采纳