<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>网站前端,web前端,前端脚本,前端优化&#124;时代前端 &#187; 检测</title>
	<atom:link href="http://www.52shidai.com/tag/%e6%a3%80%e6%b5%8b/feed" rel="self" type="application/rss+xml" />
	<link>http://www.52shidai.com</link>
	<description>网站前端研究中心</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:36:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>检测CSS是否溢出的脚本</title>
		<link>http://www.52shidai.com/javascript/688.html</link>
		<comments>http://www.52shidai.com/javascript/688.html#comments</comments>
		<pubDate>Wed, 02 Mar 2011 10:33:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[检测]]></category>
		<category><![CDATA[溢出]]></category>
		<category><![CDATA[脚本]]></category>

		<guid isPermaLink="false">http://www.52shidai.com/?p=688</guid>
		<description><![CDATA[我的理解，CSS Bug 包含： 兼容性 Bug 内容 Bug (即运营填入内容或数据库读取内容后出现的 Bug) 其中兼容性 Bug 通常在开发阶段就能解决，而内容 Bug 通常被我们忽略。比如忘记对文字设置 overflow: hidden；比如忘记对图片设置宽高；等。不知大家是否也有类似经历? 所以，为自动化这块的测试工作，我写了个 简单的脚本 ，功能有二： 文本内容 * 2 图片替换为大图 我们先拿淘宝首页开刀，看看效果。。(还是有一些可以改善的地方的) 使用很简单，在地址栏运行以下脚本即可，或者把他们加入 BookMarklet 随时运行。 文本＋图片 javascript:(function(){var f=[],h=document;(function(n){var p=arguments.callee,l=n.childNodes,m=0,k=l.length;for(;m&#60;k;m++){var o=l[m];if(o.nodeType===1){p(o)}else{if(o.nodeType===3){f.push(o)}}}})(h.body);for(var d=0;d&#60;f.length;d++){var b=f[d],j=b.nodeValue.replace(/^\s+&#124;\s+$/g,""),c=h.createTextNode(j);if(j!==""&#38;&#38;j.length!==1){b.parentNode.insertBefore(c,b)}}var g=document.images,a=0,e=g.length;for(;a&#60;e;a++){g[a].src="http://www.yoobao.com/shoppic/2010410425118938.jpg"}})(); 只文本 javascript:(function(){var list=[],doc=document;(function(parent){var func=arguments.callee,nodes=parent.childNodes,i=0,len=nodes.length;for(;i&#60;len;i++){var node=nodes[i];if(node.nodeType===1){func(node);}else if(node.nodeType===3){list.push(node);}}})(doc.body);for(var i=0;i&#60;list.length;i++){var node=list[i],value=node.nodeValue.replace(/^\s+&#124;\s+$/g,''),tmpNode=doc.createTextNode(value);if(value!==''&#38;&#38;value.length!==1){node.parentNode.insertBefore(tmpNode,node);}}})(); 只图片 javascript:(function(){var images=document.images,n=0,len=images.length;for(;n&#60;len;n++){images[n].src='http://www.yoobao.com/shoppic/2010410425118938.jpg';}})(); 最后，友情提示下： 此工具不可滥用，并非所有地方都要考虑溢出的扩展性。 打开一个网站，把上面的三个代码随意一个贴到地址栏里，回车 ok。 本文转自：http://www.chencheng.org/blog/archives/css-overflow-test-script.html &#160; 您可能感兴趣的文章用css截取文字超出部分显示省略号Web 前端优化最佳实践之 CSS 篇Monster-Chrome浏览器的扩展插件（前端检测）]]></description>
			<content:encoded><![CDATA[<p>我的理解，CSS Bug 包含：</p>
<ol>
<li>兼容性 Bug</li>
<li>内容 Bug (即运营填入内容或数据库读取内容后出现的 Bug)</li>
</ol>
<p>其中兼容性 Bug 通常在开发阶段就能解决，而内容 Bug 通常被我们忽略。比如忘记对文字设置 overflow: hidden；比如忘记对图片设置宽高；等。不知大家是否也有类似经历?</p>
<p>所以，为自动化这块的测试工作，我写了个 <a href="https://gist.github.com/846006" target="_blank">简单的脚本</a> ，功能有二：</p>
<ol>
<li>文本内容 * 2</li>
<li>图片替换为大图</li>
</ol>
<p>我们先拿淘宝首页开刀，看看效果。。(还是有一些可以改善的地方的)<br />
<a href="http://img03.taobaocdn.com/tps/i3/T17M41XnRjXXXXXXXX-1005-520.png" target="_blank"><img src="http://img03.taobaocdn.com/tps/i3/T17M41XnRjXXXXXXXX-1005-520.png" alt="" width="560" /></a></p>
<p>使用很简单，在地址栏运行以下<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/%e8%84%9a%e6%9c%ac" title="查看 脚本 中的全部文章" target="_blank">脚本</a></span>即可，或者把他们加入 <a href="http://en.wikipedia.org/wiki/Bookmarklet" target="_blank">BookMarklet</a> 随时运行。</p>
<ol>
<li><a href="http://www.chencheng.org/blog/archives/css-overflow-test-script.html">文本＋图片</a></li>
<div>
<div>
<code>javascript:(function(){var f=[],h=document;(function(n){var p=arguments.callee,l=n.childNodes,m=0,k=l.length;for(;m&lt;k;m++){var o=l[m];if(o.nodeType===1){p(o)}else{if(o.nodeType===3){f.push(o)}}}})(h.body);for(var d=0;d&lt;f.length;d++){var b=f[d],j=b.nodeValue.replace(/^\s+|\s+$/g,""),c=h.createTextNode(j);if(j!==""&amp;&amp;j.length!==1){b.parentNode.insertBefore(c,b)}}var g=document.images,a=0,e=g.length;for(;a&lt;e;a++){g[a].src="http://www.yoobao.com/shoppic/2010410425118938.jpg"}})();</code>
</div>
</div>
<li><a href="http://www.chencheng.org/blog/archives/css-overflow-test-script.html">只文本</a></li>
<div>
<div>
<code>javascript:(function(){var list=[],doc=document;(function(parent){var func=arguments.callee,nodes=parent.childNodes,i=0,len=nodes.length;for(;i&lt;len;i++){var node=nodes[i];if(node.nodeType===1){func(node);}else if(node.nodeType===3){list.push(node);}}})(doc.body);for(var i=0;i&lt;list.length;i++){var node=list[i],value=node.nodeValue.replace(/^\s+|\s+$/g,''),tmpNode=doc.createTextNode(value);if(value!==''&amp;&amp;value.length!==1){node.parentNode.insertBefore(tmpNode,node);}}})();</code>
</div>
</div>
<li><a href="http://www.chencheng.org/blog/archives/css-overflow-test-script.html">只图片</a></li>
<div>
<div>
<code>javascript:(function(){var images=document.images,n=0,len=images.length;for(;n&lt;len;n++){images[n].src='http://www.yoobao.com/shoppic/2010410425118938.jpg';}})();</code>
</div>
</div>
</ol>
<p>最后，友情提示下：</p>
<p>此工具不可滥用，并非所有地方都要考虑<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/%e6%ba%a2%e5%87%ba" title="查看 溢出 中的全部文章" target="_blank">溢出</a></span>的扩展性。</p>
<p>打开一个网站，把上面的三个代码随意一个贴到地址栏里，回车 ok。</p>
<p>本文转自：http://www.chencheng.org/blog/archives/<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/css" title="查看 css 中的全部文章" target="_blank">css</a></span>-overflow-test-script.html</p>
<p>&nbsp;</p>
<h2  class="related_post_title">您可能感兴趣的文章</h2><ul class="related_post"><li><a href="http://www.52shidai.com/css-2/885.html" title="用css截取文字超出部分显示省略号">用css截取文字超出部分显示省略号</a></li><li><a href="http://www.52shidai.com/web-front/799.html" title="Web 前端优化最佳实践之 CSS 篇">Web 前端优化最佳实践之 CSS 篇</a></li><li><a href="http://www.52shidai.com/seo/566.html" title="Monster-Chrome浏览器的扩展插件（前端检测）">Monster-Chrome浏览器的扩展插件（前端检测）</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.52shidai.com/javascript/688.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Monster-Chrome浏览器的扩展插件（前端检测）</title>
		<link>http://www.52shidai.com/seo/566.html</link>
		<comments>http://www.52shidai.com/seo/566.html#comments</comments>
		<pubDate>Tue, 13 Jul 2010 10:32:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Monster]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[检测]]></category>

		<guid isPermaLink="false">http://www.52shidai.com/?p=566</guid>
		<description><![CDATA[前端工程师的福音来了，又多了一个前端优化的好工具，怎么说这话感觉心里有种莫名的伤感，哎！前端开发者就是辛苦呀，天天要测试要分析的太多太多，要支持的要考虑的一天比一天多。 Monster是Alipay UED推出的网站代码分析、质量检测及评分的浏览器扩展，它能智能分析CSS、JS、HTML内容并生动形象展示网页得分情况(类似YSlow)。它是一个开源项目，您可以在GoogleCode中心检出MonsterForChrome项目源代码。不久会推出Firefox版扩展。 下载及演示 下载Monster 视频演示(低质量) Monster主要检测规则： 检测是否有重复ID的标签； 检测是否使用内联标签嵌套块级标签，如a嵌套div； 检测https协议页面，是否使用了http协议的图片、JS、CSS等； 检测compatMode、doctype是否出错； 检测是否使用了HTML5不再支持的标记，如font,s,u等； 检测标签是否正确关闭； 检测CSS、JS、background-image文件是否为404； 检测CSS、JS文件是否重复调用； 检测是否引用过多外部JS、CSS文件； 检测CSS、JS、HTML是否压缩； 检测CSS样式表是否使用了CSS expression； 检测Cookie是否超过30KB； 检测是否有form标签嵌套form标签； 检测是否直接在标签里定义JS事件，如&#60;a href=”#” onclick=”…”&#62;link&#60;/a&#62;； 检测&#60;meta charset=”utf-8″ /&#62;是否为&#60;head&#62;第一个子标签； 检测一个&#60;form&#62;标签内部是否出现二个input[type=submit]标签； 检测是否在&#60;form&#62;标签中使用了 id=”submit” 的标签； 检测是否将&#60;style&#62;块放置在&#60;/head&#62;前面； 检测是否将&#60;script&#62;块放置在&#60;/body&#62;前面； 检测&#60;img&#62;标签是否指定alt属性； 检测是否为input[text]指定label； 检测网页编码是否为gbk或utf-8； 检测是否使用了@import导入样式表； 如果CSS、JS指定 类似于“?t=20100405”时间戳，则自动输出最后修改时间，方便对比； 如果background-image超过6个，则提示所有背景图片及大小，超过30KB，标红显示； Monster评分规则： Monster是根据问题解决难易程度、性能提升程度、可用性提升程度以及维护性提升程度来综合评分的。具体，请下载 Monster评分算法.xls 这是Monster的第一版，欢迎抓虫，如果您有更好的改进建议，请反馈给我们。 您可能感兴趣的文章检测CSS是否溢出的脚本推荐10个Wordpress投票评级插件wp-Syntax 插件使用方法wordpress采集插件—wp-o-matic使用详解WP幻灯片插件Featured Content Gallery（FCG）汉化版五款漂亮实用的wordpress幻灯片插件给博客添加内链的2个很好的插件推荐5个漂亮的jquery主流图表插件利用301重定向改变WordPress永久链接Permalinks Migration非常漂亮的js日期控件]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink'><a href="http://www.52shidai.com" title="时代前端" target="_blank">前端</a></span>工程师的福音来了，又多了一个前端优化的好工具，怎么说这话感觉心里有种莫名的伤感，哎！前端开发者就是辛苦呀，天天要测试要分析的太多太多，要支持的要考虑的一天比一天多。</p>
<p><span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/monster" title="查看 Monster 中的全部文章" target="_blank">Monster</a></span>是Alipay UED推出的网站代码分析、质量<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/%e6%a3%80%e6%b5%8b" title="查看 检测 中的全部文章" target="_blank">检测</a></span>及评分的浏览器扩展，它能智能分析CSS、JS、HTML内容并生动形象展示网页得分情况(类似YSlow)。它是一个开源项目，您可以在GoogleCode中心检出<a href="https://code.google.com/p/monsterforchrome/">MonsterForChrome</a>项目源代码。不久会推出Firefox版扩展。</p>
<h3>下载及演示</h3>
<ul>
<li><a href="https://chrome.google.com/extensions/detail/dcnccmmdjdapgpnjhdakbjdncokmgonf" target="_blank">下载Monster</a></li>
<li><a href="http://v.youku.com/v_show/id_XMTcwNDg2Mjgw.html" target="_blank">视频演示(低质量)</a></li>
</ul>
<p><a href="http://ued.alipay.com/wp-content/uploads/2010/05/MonsterUI.png"></a></p>
<p><a href="http://ued.alipay.com/wp-content/uploads/2010/05/MonsterUI.png"><img title="MonsterUI" src="http://ued.alipay.com/wp-content/uploads/2010/05/MonsterUI.png" alt="" width="500" height="357" /></a></p>
<h3><span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/monster" title="查看 Monster 中的全部文章" target="_blank">Monster</a></span>主要<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/%e6%a3%80%e6%b5%8b" title="查看 检测 中的全部文章" target="_blank">检测</a></span>规则：</h3>
<ol>
<li><span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/%e6%a3%80%e6%b5%8b" title="查看 检测 中的全部文章" target="_blank">检测</a></span>是否有重复ID的标签；</li>
<li>检测是否使用内联标签嵌套块级标签，如a嵌套div；</li>
<li>检测https协议页面，是否使用了http协议的图片、JS、CSS等；</li>
<li>检测compatMode、doctype是否出错；</li>
<li>检测是否使用了HTML5不再支持的标记，如font,s,u等；</li>
<li>检测标签是否正确关闭；</li>
<li>检测CSS、JS、background-image文件是否为404；</li>
<li>检测CSS、JS文件是否重复调用；</li>
<li>检测是否引用过多外部JS、CSS文件；</li>
<li>检测CSS、JS、HTML是否压缩；</li>
<li>检测CSS样式表是否使用了CSS expression；</li>
<li>检测Cookie是否超过30KB；</li>
<li>检测是否有form标签嵌套form标签；</li>
<li>检测是否直接在标签里定义JS事件，如&lt;a href=”#” onclick=”…”&gt;link&lt;/a&gt;；</li>
<li>检测&lt;meta charset=”utf-8″ /&gt;是否为&lt;head&gt;第一个子标签；</li>
<li>检测一个&lt;form&gt;标签内部是否出现二个input[type=submit]标签；</li>
<li>检测是否在&lt;form&gt;标签中使用了 id=”submit” 的标签；</li>
<li>检测是否将&lt;style&gt;块放置在&lt;/head&gt;前面；</li>
<li>检测是否将&lt;script&gt;块放置在&lt;/body&gt;前面；</li>
<li>检测&lt;img&gt;标签是否指定alt属性；</li>
<li>检测是否为input[text]指定label；</li>
<li>检测网页编码是否为gbk或utf-8；</li>
<li>检测是否使用了@import导入样式表；</li>
<li>如果CSS、JS指定 类似于“?t=20100405”时间戳，则自动输出最后修改时间，方便对比；</li>
<li>如果background-image超过6个，则提示所有背景图片及大小，超过30KB，标红显示；</li>
</ol>
<h3>Monster评分规则：</h3>
<p>Monster是根据问题解决难易程度、性能提升程度、可用性提升程度以及维护性提升程度来综合评分的。具体，请下载 <a href="http://code.google.com/p/monsterforchrome/source/browse/trunk/Monster%E8%AF%84%E5%88%86%E7%AE%97%E6%B3%95.xls" target="_blank">Monster评分算法.xls</a></p>
<p>这是Monster的第一版，欢迎抓虫，如果您有更好的改进建议，请反馈给我们。</p>
<h2  class="related_post_title">您可能感兴趣的文章</h2><ul class="related_post"><li><a href="http://www.52shidai.com/javascript/688.html" title="检测CSS是否溢出的脚本">检测CSS是否溢出的脚本</a></li><li><a href="http://www.52shidai.com/wordpress/592.html" title="推荐10个Wordpress投票评级插件">推荐10个Wordpress投票评级插件</a></li><li><a href="http://www.52shidai.com/wordpress/531.html" title="wp-Syntax 插件使用方法">wp-Syntax 插件使用方法</a></li><li><a href="http://www.52shidai.com/wordpress/506.html" title="wordpress采集插件—wp-o-matic使用详解">wordpress采集插件—wp-o-matic使用详解</a></li><li><a href="http://www.52shidai.com/wordpress/489.html" title="WP幻灯片插件Featured Content Gallery（FCG）汉化版">WP幻灯片插件Featured Content Gallery（FCG）汉化版</a></li><li><a href="http://www.52shidai.com/wordpress/487.html" title="五款漂亮实用的wordpress幻灯片插件">五款漂亮实用的wordpress幻灯片插件</a></li><li><a href="http://www.52shidai.com/seo/417.html" title="给博客添加内链的2个很好的插件">给博客添加内链的2个很好的插件</a></li><li><a href="http://www.52shidai.com/javascript/jquery/372.html" title="推荐5个漂亮的jquery主流图表插件">推荐5个漂亮的jquery主流图表插件</a></li><li><a href="http://www.52shidai.com/wordpress/326.html" title="利用301重定向改变WordPress永久链接Permalinks Migration">利用301重定向改变WordPress永久链接Permalinks Migration</a></li><li><a href="http://www.52shidai.com/javascript/286.html" title="非常漂亮的js日期控件">非常漂亮的js日期控件</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.52shidai.com/seo/566.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

