//判断ip地址的合法性 function checkIP(value){ var exp=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/; var reg = value.match(exp); if(reg==null) { alert("开始的IP地址不合法!&q
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: <script> function jmp(){ var w = document.body.clientWidth; if( w > window.screen.width){ w = window.screen.width; }; if( w < 1003){ window.location.href="2.html" }; } window.onresize = jmp; jmp(); </script> 小页面里的js: &
$(window).scroll(function(){ var scrollTop=$(this).scrollTop(); var scrollHeight=$(document).height(); var windowHeight=$(this).height(); if(scrollTop+windowHeight==scrollHeight){ alert("到底了!"); } });