$(".infom_con").each(function(){ var text=$(this).find("a").text(); var len=text.length; console.log(text); if(len>100){ text = text.substring(0,99)+"..."; } $(this).find("a").html(text); });…
作者:zyl910 以往我们想在spring的xml配置文件中增加说明文本时,只能使用xml注释(<!-- 注释 -->).这对于"调试.部署时想批量屏蔽部分bean"是不利的.于是本文讨论如何解决这个难题,并给出一个对项目配置改动少的方案. 一.最初问题 例如现在想用quartz管理一个定时器类,故需要先在spring的xml配置文件中把该定时器类(JobTest)配置为bean.一般是这样写-- <!-- 测试Job. --> <bean id=&qu…
原文地址:HTML5: Wrap Block-Level Elements with A's 原文日期: 2010年06月26日 翻译日期: 2013年08月22日 对比起XHTML来说,HTML5通过更简单的元素引起了一系列的思考,坦诚地讲,这真的是急需的简化.这些简化之一就是能够通过<a>标签包装像div,h标签(h1...h6),和段落标记P 这些块级元素.你没看错:用一个A标签包裹块级元素(译者注: 在HTML5以前,a标签属于行内元素,而div,h1,p 等为块级元素,如果强行包裹,…
**label标签内含有input元素,点击事件会触发两次** 如果你的结构是label内写input实现点击文字时候input也有相应.并且,把事件设置在了label上,那么就会执行两次了. //html: <label class="first"><input type="checkbox"/>第一</label> <br/> <label class="second"><sp…
pre标签内文本自动换行 给pre标签添加一个css样式 pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.…
using System.Text.RegularExpressions; /// <summary>        /// 执行正则提取出值        /// </summary>        /// <param name="RegexString">正则表达式</param>        /// <param name="HtmlCode">HtmlCode源代码</param> …
1.获取子标签: thr_msgs = soup.find_all('div',class_=re.compile('msg'))   for i in thr_msgs:     print(i)     first = i.select('em:nth-of-type(1)')     print(first)       >>>   <div class='\"msg\"'><em>佛山</em><em>1-3年&…
textarea标签提示录入剩余字数 <textarea onkeydown="checkMaxInput(this,300)" onkeyup="checkMaxInput(this,300)" onfocus="checkMaxInput(this,300)" onblur="checkMaxInput(this,300);resetMaxmsg()" style="width:99%;height:190…
CSS: <style> .mazey{width:100px;} .nowrap{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} </style> HTML: <div class="mazey nowrap">http://www.mazey.net/baby/blog/#http://www.mazey.net/baby/blog/#http://www.mazey.net…
js 获取标签内的内容 参考:这篇博客给了我很大的启发. http://www.cnblogs.com/breakdown/archive/2012/10/09/2716221.html 我遇到的问题:获取span标签中的值51,各种折腾:正则,截取,替换,最后参考上文使用替换解决了.特感谢博主. <a href=""><span id="span4028807e4ebe04ee014ebea76a6d0001alarm" style="…