1.js 代码: <SCRIPT LANGUAGE="JavaScript"> var time = 5; //时间,秒 var timelong = 0; function diplaytime(){ //时间递减 document.all.his.innerHTML = time -timelong ; timelong ++; } function redirect(){ //跳转页 //history.back(); window.location.href=&qu
本文实例讲述了js检测离开或刷新页面时表单数据是否更改的方法.分享给大家供大家参考,具体如下: function formIsDirty(form) { for (var i = 0; i < form.elements.length; i++) { var element = form.elements[i]; var type = element.type; if (type == "checkbox" || type == "radio") { if (
实现页面的后退.刷新.前进 <html><head> <title>实现页面的后退.刷新.前进</title><script language="javascript"> function back(){ history.go(-1); //后退1页} function forward(){ history.go(+1); //前进1页} function refresh(){ histo