离开页面提示.html

<script language="javascript">
  g_blnCheckUnload = true;
  function RunOnBeforeUnload() {
     if (g_blnCheckUnload) {window.event.returnValue = '保存过编辑内容了吗?';  
     } 
  }
</script>
<body  onbeforeunload="RunOnBeforeUnload()">
<input type="submit" name="submit" value="发表" onclick="g_blnCheckUnload=false;">
</body>

你可能感兴趣的:(html)