摘要:/** * 异步轮询函数 */function get_msg (url) { $.getJSON(url, function (data) { if (data.status) { news({ "total" : data.total, "type" : data.type }); } setTimeout(function () { get_msg(url); }, 5000); });}
阅读全文
随笔分类 - Javascript
摘要:一、导入js库二、默认校验规则(1)required:true 必输字段(2)remote:"check.php" 使用ajax方法调用check.php验证输入值(3)email:true 必须输入正确格式的电子邮件(...
阅读全文
摘要:var arr = [6,5,2,8,3]; var m = Math.min.apply(null,arr); alert(m);
阅读全文
摘要:function reachBottom() { var scrollTop = 0; var clientHeight = 0; var scrollHeight = 0; if (document.documentElement && document.documentElement.scrollTop) { scrollTop = document.documentElement.scrollTop; } else if (document.body) { scrollTop = document.body.scr...
阅读全文

浙公网安备 33010602011771号