- 浏览: 1448542 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
测试
news.sohu.com
news.sina.com.cn
news.163.com
sina和163的没有jquery
所以先加这行代码
保存到收藏夹
在把下面代码保存成一行,也保存到收藏夹
new.163.com
依次点完两个收藏夹之后
页面的最下面出现3个按钮
最后生成图片预览和图片大小
----------------------------
其他
test1.html
test2.html
------------------
会出现页面变形的问题
如果是sohu的可以使用
news.sohu.com
news.sina.com.cn
news.163.com
sina和163的没有jquery
所以先加这行代码
javascript:document.body.innerHTML +="<scri"+"pt type='text/javasc"+"ript' src='http://js.sohu.com/library/jquery1.3.2.js'></scr"+"ipt>";
保存到收藏夹
在把下面代码保存成一行,也保存到收藏夹
javascript: document.body.innerHTML +="<scri"+"pt type='text/javasc"+"ript'>var oldimgcount=$('img').size();;function getNewsSohuComImg_hao(thisurl,thisid){$('#picdiv').html(thisurl+';'+$('#picdiv').html());}function createImgPic_haonn(){var imgarray=$('#picdiv').text();imgarray=imgarray.split(';');var tmpstr='';for(var imgarrayindex=0;imgarrayindex<imgarray.length-1;imgarrayindex++){tmpstr+='<img id=haha'+imgarrayindex+' src='+imgarray[imgarrayindex]+' />';$('#picdiv').html(tmpstr);}}function countImgSize_haonn(){$('img').each(function(index){if(index>=oldimgcount){$('#jieguo').html($(this).attr('src')+' width:'+$(this).width()+' height:'+$(this).height()+'</br>'+$('#jieguo').html());}});}function countImgUrl_haonn(){for(var thisi=0;thisi<$('img').size();thisi++){var ull=$('img').eq(thisi).attr('src');getNewsSohuComImg_hao(ull,'haohao'+thisi);}}</scri"+"pt>"; document.body.innerHTML +="<hr /><input type='button' onclick='countImgUrl_haonn()' value='提取url'/>"; document.body.innerHTML += "<input type='button' onclick='createImgPic_haonn()' value='生成图片'/>"; document.body.innerHTML +="<input type='button' onclick='countImgSize_haonn()' value='判断大小'/>"; document.body.innerHTML +="<div id='jieguo'></div>"; document.body.innerHTML +="<div id='picdiv'></div>";
new.163.com
依次点完两个收藏夹之后
页面的最下面出现3个按钮
最后生成图片预览和图片大小
----------------------------
其他
test1.html
<html> <head> <title>mytest</title> </head> <body> <script type="text/javascript" src="http://js.sohu.com/library/jquery1.3.2.js" ></script> <img src="http://ww1.sinaimg.cn/large/67b98b3djw1dptmqg51lbj.jpg" width="100" height="100" style="width:100;height:100"/> <img src="http://ww2.sinaimg.cn/large/6966d53egw1dptmcb4663j.jpg" width="100" height="100" style="width:100;height:100"/> </body> </html> <script type="text/javascript"> $("body").append("<hr /><input type='button' onclick='countImgUrl_haonn()' value='提取url'/>"); $("body").append("<input type='button' onclick='createImgPic_haonn()' value='生成图片'/>"); $("body").append("<input type='button' onclick='countImgSize_haonn()' value='判断大小'/>"); $("body").append("<div id='jieguo'></div>"); $("body").append("<div id='picdiv'></div>"); //$("body").append("<scri"+"pt type='text/javascript'>alert('haha');</scri"+"pt>"); //-----------下面代码不要有注释----生成一行给test2.html var oldimgcount=$('img').size(); function getNewsSohuComImg_hao(thisurl,thisid){ $('#picdiv').html(thisurl+';'+$('#picdiv').html()); } function createImgPic_haonn(){ var imgarray=$('#picdiv').text(); imgarray=imgarray.split(';'); var tmpstr=''; for(var imgarrayindex=0;imgarrayindex<imgarray.length-1;imgarrayindex++){ tmpstr+='<img id=haha'+imgarrayindex+' src='+imgarray[imgarrayindex]+' />'; $('#picdiv').html(tmpstr); } } function countImgSize_haonn(){ $('img').each(function(index){ if(index>=oldimgcount){ $('#jieguo').html($(this).attr('src')+'---width:'+$(this).width()+',height:'+$(this).height()+'</br>'+$('#jieguo').html()); } }); } function countImgUrl_haonn(){ for(var thisi=0;thisi<$('img').size();thisi++){ var ull=$('img').eq(thisi).attr('src'); getNewsSohuComImg_hao(ull,'haohao'+thisi); } } </script>
test2.html
<html> <head> <title>mytest</title> <script type="text/javascript" src="http://js.sohu.com/library/jquery1.3.2.js" ></script> </head> <body> <img src="http://ww1.sinaimg.cn/large/67b98b3djw1dptmqg51lbj.jpg" width="100" height="100" style="width:100;height:100"/> <img src="http://ww2.sinaimg.cn/large/6966d53egw1dptmcb4663j.jpg" width="100" height="100" style="width:100;height:100"/> </body> </html> <script type="text/javascript"> // document.body.innerHTML +="<scri"+"pt type='text/javasc"+"ript' src='http://js.sohu.com/library/jquery1.3.2.js'></scr"+"ipt>"; $("body").append("<scri"+"pt type='text/javasc"+"ript'>var oldimgcount=$('img').size();function getNewsSohuComImg_hao(thisurl,thisid){$('#picdiv').html(thisurl+';'+$('#picdiv').html());}function createImgPic_haonn(){var imgarray=$('#picdiv').text();imgarray=imgarray.split(';');var tmpstr='';for(var imgarrayindex=0;imgarrayindex<imgarray.length-1;imgarrayindex++){tmpstr+='<img id=haha'+imgarrayindex+' src='+imgarray[imgarrayindex]+' />';$('#picdiv').html(tmpstr);}}function countImgSize_haonn(){$('img').each(function(index){if(index>=oldimgcount){$('#jieguo').html($(this).attr('src')+'---width:'+$(this).width()+',height:'+$(this).height()+'</br>'+$('#jieguo').html());}});}function countImgUrl_haonn(){for(var thisi=0;thisi<$('img').size();thisi++){var ull=$('img').eq(thisi).attr('src');getNewsSohuComImg_hao(ull,'haohao'+thisi);}}</scri"+"pt>"); $("body").append("<hr /><input type='button' onclick='countImgUrl_haonn()' value='提取url'/>"); $("body").append("<input type='button' onclick='createImgPic_haonn()' value='生成图片'/>"); $("body").append("<input type='button' onclick='countImgSize_haonn()' value='判断大小'/>"); $("body").append("<div id='jieguo'></div>"); $("body").append("<div id='picdiv'></div>"); </script>
------------------
会出现页面变形的问题
如果是sohu的可以使用
javascript:$("body").append("<scri"+"pt type='text/javasc"+"ript'>var oldimgcount=$('img').size();;function getNewsSohuComImg_hao(thisurl,thisid){$('#picdiv').html(thisurl+';'+$('#picdiv').html());}function createImgPic_haonn(){var imgarray=$('#picdiv').text();imgarray=imgarray.split(';');var tmpstr='';for(var imgarrayindex=0;imgarrayindex<imgarray.length-1;imgarrayindex++){tmpstr+='<img id=haha'+imgarrayindex+' src='+imgarray[imgarrayindex]+' />';$('#picdiv').html(tmpstr);}}function countImgSize_haonn(){$('img').each(function(index){if(index>=oldimgcount){$('#jieguo').html($(this).attr('src')+' width:'+$(this).width()+' height:'+$(this).height()+'</br>'+$('#jieguo').html());}});}function countImgUrl_haonn(){for(var thisi=0;thisi<$('img').size();thisi++){var ull=$('img').eq(thisi).attr('src');getNewsSohuComImg_hao(ull,'haohao'+thisi);}}</scri"+"pt>");$("body").append("<hr /><input type='button' onclick='countImgUrl_haonn()' value='text0'/>");$("body").append("<input type='button' onclick='createImgPic_haonn()' value='text1'/>");$("body").append("<input type='button' onclick='countImgSize_haonn()' value='text2'/>");$("body").append("<div id='jieguo'></div>");$("body").append("<div id='picdiv'></div>");
发表评论
-
indexedDB存图片减少请求
2020-05-21 19:23 519getImageFile()获取网络图片 showImage ... -
vizceral-example的例子
2020-03-19 18:53 323自定义图和加载结构 代码在 https://github.c ... -
jsonpath的helloworld
2020-03-17 14:58 379基本语法:https://www.cnblogs.com/jp ... -
流动图神器vizceral
2019-10-12 19:04 442把c的代码生成json:https://github.com/ ... -
emscripten asm.js的helloworld
2018-03-01 20:15 1072mac下安装: brew install SDL2 SDL2_ ... -
websocket上传文件
2016-12-15 13:30 4381nginx的上传 查看http://haoningabc.it ... -
webpack的helloworld
2016-11-02 10:42 882参考 http://www.jianshu.com/p/42e ... -
iphone6等移动端的css自适应
2016-10-17 01:18 1173参考 http://jingyan.baidu.com/art ... -
javascript自定义事件
2016-06-01 21:49 527一言不合上代码 <input value=" ... -
html5的fiesystem api 浏览器本地存储
2016-06-01 15:59 891html5的fiesystem api可以存取本地文件 一言不 ... -
websocket传传图片
2015-12-25 17:51 7212参考[url]http://www.adobe.com/dev ... -
angularjs使用include后双向绑定失败的解决
2015-12-20 19:41 1840原理参考 http://segmentfault.com/q/ ... -
html5 陀螺仪
2014-11-26 21:05 5826<html> <head> ... -
webgl的贝塞尔曲线
2014-11-12 00:56 2494BezierCurve webgl的贝塞尔曲线 webgl ... -
chrome app的helloworld
2014-11-11 13:56 674参考 http://blog.csdn.net/rydiy/a ... -
shader and Program编程基本概念 - 转
2014-11-04 11:50 1472原地址:http://blog.csdn.net/myarro ... -
javascript对象转json
2014-10-17 14:09 969<html> <head>& ... -
jquery 的svg中国地图
2012-12-16 14:37 28040三种吧 1.d3.js很强大 2.jquery的 jvecto ... -
纯css的树型结构
2012-10-03 18:29 1238<html><head> ... -
D3 的3d图
2012-09-16 17:05 1430LCF http://mathworld.wolfram. ...
相关推荐
js 图片 验证上传图片 大小 格式
上传图片大小验证方法 非完整控件 如需要可以加入正则表达式来判断上传文件扩展名
js控制图片大小,并验证图片类型,兼容各浏览器,测试可用
Javascript验证上传图片大小[前台处理]_.docx
上传图片时因为服务器资源有限,经常会规定图片最大不超过多少,所以在上传之前还要进行图片大小的一个验证。今天就让我们来做一下这两个验证。 验证文件类型,看看所选文件是不是图片: 代码如下: //文件类型: ...
基于jquery实现的上传图片及图片大小验证、图片预览效果代码,需要的朋友可以参考下。
上传图片格式大小检测,很好的上传功能.在验证上传的图片是否合法时,比较实用。
该代码是实现.net web开发的图片验证技术,可实现图片类型,大小的限制
下面小编就为大家带来一篇JS验证图片格式和大小并预览的简单实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
在网上真得好难找到一个能在网页上对视频进行上传大小的拦截与阻止的控件。在服务器端作验证又太麻烦。现在终于有了一个解决方案纯javascript解决方案。
上传图片的时候需要校验图片的各种规则,小编也百度了好多,很多都不能直接使用,所以小编就自己整理了一下.已经验证有效.希望对你们有帮助.
JS验证页面属性,限制多表单提交动作,时间大小比较,图片格式的验证,基本的页面验证...包括JS事件大全,js验证大全,JS正则表达式...
验证上传图片格式 判定大小 标准HTML5
Imagenet验证集数据大小为6.5G,共有1000类的50000张图片。本文主要是对这1000类的50000张图片的标签信息。
在项目中,我们经常要遇到上传图片,这就需要我们必须要验证图片的格式与大小,那么如何来操作呢,今天就给大家分享一个非常简单的jQuery验证上传图片的格式与大小的代码。
验证码图片的边框颜色由imagerectangle($img, 0, 0, 144, 19, $white)中$white决定,文字的大小由imagestring()中的第二个参数决定。字符串颜色可根据需求分配画布颜色,使用函数imagecolorallocate()。
需求分析: 在做上传图片的时候,如果不限制上传图片大小,后果非常的严重。那么我们怎样才可以解决一个棘手的问题呢?有两种方式: 1)后台处理: 也就是AJAX POST提交到后台,把图片上传到服务器上,然后获得该图片...
在做上传图片的时候,如果不限制上传图片大小,后果非常的严重。解决这个问题有两种方式:后台处理、前台处理