
javascript/jq
luck-cheng
It is my github addr, https://github.com/luck-cheng,
It is my gitee addr, https://gitee.com/luck-cheng.
展开
-
JQuery - 点击浏览器后退键时发出警告 (demo)
jQuery(document).ready(function () { if (window.history && window.history.pushState) {) { if (window.history && window.history.pushState) {转载 2017-01-04 08:58:44 · 2310 阅读 · 0 评论 -
js判断文件格式及大小
//上传文件大小以及格式验证 function getPhotoSize(obj){ photoExt=obj.value.substr(obj.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名 if(photoExt!='.jpg'){ alert("请上传后缀名为jpg的照片!"); r原创 2017-01-04 09:35:18 · 4006 阅读 · 0 评论 -
[JavaScript]页面判断上传文件大小
因为项目中使用七牛云的直传文件,上传策略的大小限制搞不定,所以,使用JavaScript在页面判断,代码非原创,从网上收集,自己测试可用(Firefox、Chrome、Internet Exeplorer 10); var isIE = /msie/i.test(navigator.userAgent) && !window.opera; function fileChange(tar原创 2017-08-16 15:43:25 · 3686 阅读 · 0 评论