<?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>.::灵狼天::. &#187; JavaScript</title>
	<atom:link href="http://icyleaf.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://icyleaf.com</link>
	<description>icyleaf&#039;s blog - 心外无理，心外无物，心外无事</description>
	<lastBuildDate>Tue, 13 Dec 2011 02:34:45 +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>如何获取 Element 的 XPath [PHP/Javascript]</title>
		<link>http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/</link>
		<comments>http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 03:04:20 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[网络开发]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XPath]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=759</guid>
		<description><![CDATA[这两天研究 HTML 的 DOM 需要寻找某个 Element 元素的完整 XPath 路径，由于使用的是 PHP Simple HTML DOM Parser 开源库，这个库类的使用方法几乎兼容 Javascript 的 DOM 语法并附带 DOM 选择器。虽然功能强大但是并不能直接获取 Element 的 XPath。这个怎么办呢，依稀记得 Firebug 有一个功能，选择某个元素在它的控制台可以显示 XPath。嗯，着手实践一下发现不仅可以显示而且还可以复制 XPath。 于是想，如果可以找到 Javascript 版的相关代码就一定可以改成 PHP 版本的，结果在 Google 搜索找到了&#8230; var elt = document.getElementById('table'); var &#8230; <a href="http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>这两天研究 HTML 的 DOM 需要寻找某个 Element 元素的完整 XPath 路径，由于使用的是 <a href="http://simplehtmldom.sourceforge.net/manual.htm">PHP Simple HTML DOM Parser</a> 开源库，这个库类的使用方法几乎兼容 Javascript 的 DOM 语法并附带 DOM 选择器。虽然功能强大但是并不能直接获取 Element 的 XPath。这个怎么办呢，依稀记得 Firebug 有一个功能，选择某个元素在它的控制台可以显示 XPath。嗯，着手实践一下发现不仅可以显示而且还可以复制 XPath。</p>
<p>于是想，如果可以找到 Javascript 版的相关代码就一定可以改成 PHP 版本的，结果在 Google 搜索找到了&#8230;</p>
<pre lang="javascript" line="1" colla="+">
var elt = document.getElementById('table');
var xpath = getElementXPath(elt);
alert(xpath);

// Get full XPath of an element
function getElementXPath(elt)
{
	var path = "";
	for (; elt &#038;&#038; elt.nodeType == 1; elt = elt.parentNode)
	{
		idx = getElementIdx(elt);
		xname = elt.tagName;
		if (idx > 1) xname += "[" + idx + "]";
		path = "/" + xname + path;
	}

	return path;
}

// Get Idx of an element
function getElementIdx(elt)
{
    var count = 1;
    for (var sib = elt.previousSibling; sib ; sib = sib.previousSibling)
    {
        if(sib.nodeType == 1 &#038;&#038; sib.tagName == elt.tagName)	count++
    }

    return count;
}
</pre>
<p>PHP 改进版：</p>
<pre lang="php" line="1" colla="+">
// Use it before import PHP Simple HTML DOM Parser
$html = file_get_html('http://www.google.com/');
// find a sample element by id
$elt1 = $html->find('#footer', 0);
// find a sample element by tag name
$elt2= $html->find('div', 10);

// it will return if found it: //*[@id="footer"]
$xpath = getElementXPath($elt1);

// it will return if found it: html/body/div[10]
$xpath = getElementXPath($elt2);

function getElementXPath($elt)
{
	$path = '';
	$first = TRUE;
	for(; ($elt AND $elt->nodetype == 1); $elt = $elt->parent())
	{
		$xname = $elt->tag;
		$idx = getElementIdx($elt);

		if ($first AND isset($elt->attr['id']))
		{
			$path = '//*[@id="' . $elt->attr['id'] . '"]';
			break;
		}

		if ($idx > 1)
		{
			$xname .= '[' . $idx . ']';
		}

		$path = '/'.$xname.$path;

		$first = FALSE;
	}

	return $path;
}

function getElementIdx($elt)
{
    $count = 1;
    for($sib = $elt->prev_sibling(); $sib ; $sib = $sib->prev_sibling())
    {
        if($sib->nodetype == 1 &#038;&#038; $sib->tag == $elt->tag)
        {
        	$count++;
        }
    }

    return $count;
}
</pre>
<p>大家同样可以把上面的代码直接 crack 到 PHP Simple HTML DOM Parser 库中。</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2010/04/how-to-get-xpath-of-an-element-for-php-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery Selectors：让你迅速了解 jquery</title>
		<link>http://icyleaf.com/2008/11/jquery-selectors/</link>
		<comments>http://icyleaf.com/2008/11/jquery-selectors/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 02:40:52 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=448</guid>
		<description><![CDATA[jquery 作为一个风靡流行 JavaScript 框架，一直在互联网开发做着重要的角色，其实它上手也很简单，今天在订阅的 Gr 发现了这个 labs 性的 jquery Selectors。打开这个页面，你会看到在左侧有很多的 jquery 选择器，大家可以通过点击各种的按钮可以在右侧清楚的看到实现选择了那个元素。同时还配有文档说明，很棒的教学学习资料：） 如果你想给离线的朋友使用，那也没有关系，它提供了源码的下载，就在右侧的顶部（点击这里也可以下载）。 看到它这样页面的顶部信息让我有发现了两个很不错 jquery 学习资料网站：LearningjQuery &#124; codylindley。 BTW，人家顶部信息说了：FYI (ie6 != supported)，难道你还在用 IE6 开发么? XD]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.com/" target="_self">jquery </a>作为一个风靡流行 JavaScript 框架，一直在互联网开发做着重要的角色，其实它上手也很简单，今天在订阅的 Gr 发现了这个 labs 性的<a href="http://codylindley.com/jqueryselectors/" target="_self"> jquery Selectors</a>。打开这个页面，你会看到在左侧有很多的 jquery 选择器，大家可以通过点击各种的按钮可以在右侧清楚的看到实现选择了那个元素。同时还配有文档说明，很棒的教学学习资料：）</p>
<p>如果你想给离线的朋友使用，那也没有关系，它提供了源码的下载，就在右侧的顶部（<a href="http://www.codylindley.com/jqueryselectors.zip" target="_self">点击这里</a>也可以下载）。</p>
<p>看到它这样页面的顶部信息让我有发现了两个很不错 jquery 学习资料网站：<a href="http://www.learningjquery.com/" target="_self">LearningjQuery</a> | <a href="http://www.codylindley.com/" target="_self">codylindley</a>。</p>
<p>BTW，人家顶部信息说了：<strong>FYI (ie6 != supported)</strong>，难道你还在用 IE6 开发么?<strong> XD<br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/11/jquery-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blackbird：JavaScript调试，对alert说拜拜</title>
		<link>http://icyleaf.com/2008/10/blackbird-javascript-debugging-on-the-alert-shui-baibai/</link>
		<comments>http://icyleaf.com/2008/10/blackbird-javascript-debugging-on-the-alert-shui-baibai/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 09:07:41 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=410</guid>
		<description><![CDATA[最近就在用 JavaScript 写公司系统的报表文件生成编辑器工具。调试的头胀闹大的。尤其是加入 alert()  调试框，一不小心就会进入慢长的循环，点不掉的 alert 框&#8230;幸好在 webappers 发现了 Blackbird 提供一种非常酷的 JavaScript 调试信息显示方法。直接让我告别了 alert() 时代。:) Blackbird 支持当前的主流版本浏览器（IE 6+，Firefox 2+，Safari 2+，Opera 9.5），可以区别输入 debug，info，warn，error，profile。同时可以通过热键来控制显示/隐藏，情况记录调试信息等操作！ 使用方法也很简单，加载 js 和 css 文件并加载到 header 区域，直接使用就可以输出调试信息： log.debug( 'this is a debug message' ); log.info( 'this is an &#8230; <a href="http://icyleaf.com/2008/10/blackbird-javascript-debugging-on-the-alert-shui-baibai/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Blackbird" src="http://www.webappers.com/img/2008/10/blackbird.png" alt="" width="480" height="218" /></p>
<p>最近就在用 JavaScript 写公司系统的报表文件生成编辑器工具。调试的头胀闹大的。尤其是加入 alert()  调试框，一不小心就会进入慢长的循环，点不掉的 alert 框&#8230;幸好在 <a href="http://www.webappers.com/2008/10/15/blackbird-open-source-javascript-logging-utility/" target="_self">webappers</a> 发现了 <a href="http://www.gscottolson.com/blackbirdjs/" target="_self">Blackbird </a>提供一种非常酷的 JavaScript 调试信息显示方法。直接让我告别了 alert() 时代。:)</p>
<p><a href="http://www.gscottolson.com/blackbirdjs/" target="_self">Blackbird</a> 支持当前的主流版本浏览器（IE 6+，Firefox 2+，Safari 2+，Opera 9.5），可以区别输入 debug，info，warn，error，profile。同时可以通过热键来控制显示/隐藏，情况记录调试信息等操作！<br />
使用方法也很简单，加载 js 和 css 文件并加载到 header 区域，直接使用就可以输出调试信息：</p>
<pre lang="javascript" line="1" colla="+">
log.debug( 'this is a debug message' );
log.info( 'this is an info message' );
log.warn( 'this is a warning message' );
log.error( 'this is an error message' );
</pre>
<p>演示：<a href="http://www.gscottolson.com/blackbirdjs/"  target="_self">http://www.gscottolson.com/blackbirdjs/</a></p>
<p>下载：<a href="http://blackbirdjs.googlecode.com/">当前版本 blackbirdjs v1.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/10/blackbird-javascript-debugging-on-the-alert-shui-baibai/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Devunity：随心所欲在线编程</title>
		<link>http://icyleaf.com/2008/10/devunity-way-online-programming/</link>
		<comments>http://icyleaf.com/2008/10/devunity-way-online-programming/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 03:53:48 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Webware]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://icyleaf.com/?p=388</guid>
		<description><![CDATA[Devunity 是一个极具创意性的在线编程服务网站，使用它就像是在使用系统的文本编辑器一样，支php，Python，Javascript，Perl，Html，Asp，Css，Ruby语言语法高亮，行数显示，支持 Tags。最大的特性还属创建项目，从SVN服务导入代码，支持多种服务的API（如 Twitter，Flickr，BOSS，Google Apps Engine,，Digg，Facebook等等）接口编程到团队协作，添加 Todos。 Devunity 是TechCrunch 最新评出来的 TC50 之一。目前这个服务还属于开发当作，之前只是申请才能获得邀请，过了一个10.1终于给了邀请，碰巧通过内测用户邀请是可以直接申请到用户，所以，如果你想尝试一下，留下你的 Email 地址吧:)]]></description>
			<content:encoded><![CDATA[<p><img style="border: none;" title="Devunity" usemap="#map_fixf94x5" src="http://kwout.com/cutout/f/ix/f9/4x5_bor_rou_sha.jpg" alt="http://www.devunity.com/user" width="508" height="284" /></p>
<p><a href="http://www.devunity.com/" target="_self">Devunity</a> 是一个极具创意性的在线编程服务网站，使用它就像是在使用系统的文本编辑器一样，支php，Python，Javascript，Perl，Html，Asp，Css，Ruby语言语法高亮，行数显示，支持 Tags。最大的特性还属创建项目，从SVN服务导入代码，支持多种服务的API（如 Twitter，Flickr，BOSS，Google Apps Engine,，Digg，Facebook等等）接口编程到团队协作，添加 Todos。</p>
<p><a href="http://www.devunity.com/" target="_self">Devunity</a> 是<a class="entry-source-title" href="http://www.google.com/reader/view/feed/http%3A%2F%2Ffeeds.feedburner.com%2FTechCrunch" target="_blank">TechCrunch</a> 最新评出来的 <a href="http://www.techcrunch.com/2008/09/08/announcing-the-techcrunch50-finalists/" target="_self">TC50</a> 之一。目前这个服务还属于开发当作，之前只是申请才能获得邀请，过了一个10.1终于给了邀请，碰巧通过内测用户邀请是可以直接申请到用户，所以，如果你想尝试一下，留下你的 Email 地址吧:)</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/10/devunity-way-online-programming/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>图片保护脚本：dwProtector</title>
		<link>http://icyleaf.com/2008/08/mootools-dwprotector/</link>
		<comments>http://icyleaf.com/2008/08/mootools-dwprotector/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 07:49:16 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=249</guid>
		<description><![CDATA[网站的图片保护是一个热门话题，为什么呢？你想想如果您辛辛苦苦花了两个小时设计出来个设计，你会希望它被别人无情的PS，修改做别人的东西吗？当然是被允许的，这就是dwProtector产生的原因。 dwProtector是基于mootools开发的插件。那么，dwProtector的功能强度有多大呢，看下面列表： 守护右键“（图片）另存为”（&#8221;Save Image As&#8221;） 守护右键“背景图片另存为”（&#8221;Save Background As&#8221;） 守护拖拽图片到桌面 甚至是守护右键 在线功能演示：http://davidwalsh.name/dw-content/image-protector.php 里面的图片很凶猛哦&#8230; 核心代码： //protector class var dwProtector = new Class({ //implements Implements: [Options], //options options: { image: 'blank.gif', elements: $$('img'), zIndex: 10 }, //initialization initialize: function(options) { //set options this.setOptions(options); &#8230; <a href="http://icyleaf.com/2008/08/mootools-dwprotector/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>网站的图片保护是一个热门话题，为什么呢？你想想如果您辛辛苦苦花了两个小时设计出来个设计，你会希望它被别人无情的PS，修改做别人的东西吗？当然是被允许的，这就是<a href="http://davidwalsh.name/mootools-12-image-protector-dwprotector" target="_blank">dwProtector</a>产生的原因。</p>
<p><a href="http://davidwalsh.name/mootools-12-image-protector-dwprotector" target="_blank">dwProtector</a>是基于<a href="http://mootools.net/" target="_blank">mootools</a>开发的插件。那么，dwProtector的功能强度有多大呢，看下面列表：</p>
<ul>
<li>守护右键“（图片）另存为”（&#8221;Save Image As&#8221;）</li>
<li>守护右键“背景图片另存为”（&#8221;Save Background As&#8221;）</li>
<li>守护拖拽图片到桌面</li>
<li>甚至是守护右键</li>
</ul>
<p><span id="more-249"></span></p>
<p>在线功能演示：<a href="http://davidwalsh.name/dw-content/image-protector.php" target="_blank">http://davidwalsh.name/dw-content/image-protector.php</a><br />
里面的图片很凶猛哦&#8230;</p>
<p><strong>核心代码</strong>：</p>
<pre lang="javascript" line="1" file="protector.txt" colla="-">
//protector class
var dwProtector = new Class({

	//implements
	Implements: [Options],

	//options
	options: {
		image: 'blank.gif',
		elements: $$('img'),
		zIndex: 10
	},

	//initialization
	initialize: function(options) {
		//set options
		this.setOptions(options);

		//make it happen
		this.protect();
	},

	//a method that does whatever you want
	protect: function() {
		//for each image that needs be protected...
		this.options.elements.each(function(el) {
			//get the element's position, width, and height
			var size = el.getCoordinates();
			//create the protector
			var p = new Element('img', {
				src: this.options.image,
				width: size.width,
				height: size.height,
				styles: {
					'z-index': this.options.zIndex,
					'left': size.left + 'px',
					'top': size.top + 'px',
					'position': 'absolute'
				}
			}).inject($(document.body),'top');
		},this);

	}
});
</pre>
<p>通过上面的代码可以发现，用户虽然可以上面的方法保存图片，不过下载下来的图片只是我们函数里面替换掉的blank.gif。</p>
<p><strong>使用方法</strong>：<br />
1. 下载<a href="http://mootools.net/download" target="_blank">mootools</a>和<a href="http://davidwalsh.name/dw-content/dwProtect.js" target="_blank">dwProtector</a>以及空的<a href="http://davidwalsh.name/dw-content/blank.gif" target="_blank">替换图片blank.gif</a>，下载后放置在网站合适的位置。<br />
2. 把下面代码插入到全局的头部文件中(<head></head>）：</p>
<pre lang="html4strict" line="1" file="html.txt" colla="+">
<script type="text/javascript" src="moo1.2.js"></script>

<!-- 或者直接插入上面的核心代码 -->
<script type="text/javascript" src="dwProtect.js"></script>
<script type="text/javascript">
window.addEvent('domready', function() {  
var protector = new dwProtector({  
image: '/blank.gif',  
elements: $$('.protect')    //设置图片保护标记，这里为class="protect"
});  
});
</script>
</pre>
<p>3.在你的图片加入 <strong>class=&#8221;protect&#8221;</strong>（可以通过步骤2修改保护图片标记），如：</p>
<pre lang="hhtml4stricttml" line="1" file="img.txt" colla="+">
<img src="sample.jpg" class="protect" alt="sample"/>
</pre>
<p>作者在结尾声明，对于查看网页源文件或其他方法还是可以很轻松的获得图片的地址，而且我还尝试用选中图片，复制，粘贴在富文本编辑器下面也是可以显示的&#8230;不过作者目前还在想办法解决这方面的问题，让我们一起为作者加油吧！</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/08/mootools-dwprotector/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>网络开发者调试工具小盘点</title>
		<link>http://icyleaf.com/2008/08/webdev-tools-lite/</link>
		<comments>http://icyleaf.com/2008/08/webdev-tools-lite/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 09:01:52 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=241</guid>
		<description><![CDATA[无论是什么样的开发者都必不可缺少的就是调试，当然本篇介绍的工具均是适用于网络开发者，我按照软件平台的不同分了几类：Firefox扩展类，IE插件类，书签工具类，JavaScript类，当然还有其他类等。其中之前介绍的5个最棒的Firebug扩展可以分在Firefox扩展类，其他本篇将主要介绍剩下的两个分类的调试工具。 书签工具类 所谓书签工具类，实际上就是通过点击书签就可以实现运行调试工具的方法类别。 安装方法也非常的简单，对于FireFox用户，直接把指定保存书签的按钮（或链接）拖拉到书签工具栏；对于IE用户，在指定保存书签的按钮（或链接）右键，选择“添加到收藏夹“。 使用的时候，直接点击那个书签即可运行调试工具。 XRAY （支持IE6+/Firefox/Safari/Camino） 简单的DOM查看器，运行后点击网页的元素，弹出的窗口会显示相关的DOM信息。不过要注意对于查看的元素是链接是无法查看的。因为&#8230;.因为&#8230;浏览器直接就跳转到你点击了那个链接上去了&#8230; Firebug Lite （支持IE6+/Firefox/Safari/Opera） 没错，Firebug的作者为了让不同浏览器的开发者都能用到Firebug，精心打造了这个JavaScript版本，此版本实现了fx扩展的大部分功能。强烈推荐哦，哈哈。 ReCSS （支持IE6+/Firefox/Safari） 功能是重载CSS，其实看名字也会了解，主要是为了在修改CSS后，同时在不重新加载网页内容的情况下达到重载CSS后的效果。简单的说只节省调试时间，要不每次都是全部重载所有的资料多浪费时间啊～ Layout Grid Bookmarklet （支持IE6+/Firefox/Safari/Opera） 标尺工具，可以让你的网页背景变成一个标尺，提供的版本比较多（固定版和浮动版），大家使用时需要多看看，标尺长宽为1000&#215;1000像素。 JavsScript类 Firebug Lite （支持IE6+/Firefox/Safari/Opera） 没错，它不仅提供书签工具版也提供JavaScript版本，直接把下面的代码放在你要调试的网页里面就可以啦。 Pi.debugger 直接点上面的链接吧，那个是我之前专门介绍的文章XD IE插件类 如果你使用的是IE8就算了，就跳过本类别吧:)另外这个类别不做重点简单介绍，因为网上这样的文章太泛滥了。 首先我要介绍和推荐的是微软自己出的Visual Web Developer，免费产品，功能还蛮不错，再者就是收费产品IE WebDeveloper，这个其实我还是蛮喜欢的，网上破解/注册版一片，我就不多说。其他的还有IEDevToolBar。]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="webdev" src="http://photo1.bababian.com/upload12/20080805/DCB7A774FCDC11B8A396BAAA8231DC6F.jpg" alt="" width="411" height="153" /></p>
<p>无论是什么样的开发者都必不可缺少的就是调试，当然本篇介绍的工具均是适用于网络开发者，我按照软件平台的不同分了几类：Firefox扩展类，IE插件类，书签工具类，JavaScript类，当然还有其他类等。其中之前介绍的<a title="Permanent Link to 推荐5个最棒的Firebug扩展" href="http://www.icyleaf.cn/2008/07/22/the-5-best-firebug-extensions/">5个最棒的Firebug扩展</a>可以分在Firefox扩展类，其他本篇将主要介绍剩下的两个分类的调试工具。</p>
<h2>书签工具类</h2>
<p>所谓书签工具类，实际上就是通过点击书签就可以实现运行调试工具的方法类别。<br />
安装方法也非常的简单，对于FireFox用户，直接把指定保存书签的按钮（或链接）拖拉到书签工具栏；对于IE用户，在指定保存书签的按钮（或链接）右键，选择“添加到收藏夹“。<br />
使用的时候，直接点击那个书签即可运行调试工具。</p>
<p><strong><a href="http://westciv.com/xray/" target="_blank">XRAY</a></strong> （支持IE6+/Firefox/Safari/Camino）<br />
<img class="alignnone" title="xray" src="http://westciv.com/xray/xrayexample.png" alt="" width="454" height="388" /></p>
<h2><span id="more-241"></span></h2>
<p>简单的DOM查看器，运行后点击网页的元素，弹出的窗口会显示相关的DOM信息。不过要注意对于查看的元素是链接是无法查看的。因为&#8230;.因为&#8230;浏览器直接就跳转到你点击了那个链接上去了&#8230;</p>
<p><a href="http://getfirebug.com/lite.html" target="_blank"><strong>Firebug Lite</strong></a> （支持IE6+/Firefox/Safari/Opera）<br />
<img class="alignnone" title="firefox Lite" src="http://getfirebug.com/firebugxb-sm.gif" alt="" width="414" height="257" /><br />
没错，Firebug的作者为了让不同浏览器的开发者都能用到Firebug，精心打造了这个JavaScript版本，此版本实现了fx扩展的大部分功能。强烈推荐哦，哈哈。</p>
<p><strong><a href="http://turtle.dojotoolkit.org/~david/recss.html" target="_blank">ReCSS</a></strong> （支持IE6+/Firefox/Safari）<br />
功能是重载CSS，其实看名字也会了解，主要是为了在修改CSS后，同时在不重新加载网页内容的情况下达到重载CSS后的效果。简单的说只节省调试时间，要不每次都是全部重载所有的资料多浪费时间啊～</p>
<p><strong><a href="http://www.andybudd.com/archives/2006/07/layout_grid_bookmarklet/" target="_blank">Layout Grid Bookmarklet</a></strong> （支持IE6+/Firefox/Safari/Opera）<br />
<img class="alignnone" title="Layout Grid" src="http://www.andybudd.com/archives/images/grid.png" alt="" width="400" height="200" /><br />
标尺工具，可以让你的网页背景变成一个标尺，提供的版本比较多（固定版和浮动版），大家使用时需要多看看，标尺长宽为1000&#215;1000像素。</p>
<h2>JavsScript类</h2>
<p><a href="http://getfirebug.com/lite.html" target="_blank"><strong>Firebug Lite</strong></a> （支持IE6+/Firefox/Safari/Opera）<br />
没错，它不仅提供书签工具版也提供JavaScript版本，直接把下面的代码放在你要调试的网页里面就可以啦。<br />
<coolcode lang="html"><br />
<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script><br />
</coolcode></p>
<p><a href="http://www.icyleaf.cn/2008/04/14/pi-debugger/" target="_blank">Pi.debugger</a><br />
<img class="alignnone" title="pi.debugger" src="http://ajaxian.com/wp-content/images/pidebugger.png" alt="" width="450" height="400" /><br />
直接点上面的链接吧，那个是我之前专门介绍的文章XD</p>
<h2>IE插件类</h2>
<p>如果你使用的是IE8就算了，就跳过本类别吧:)另外这个类别不做重点简单介绍，因为网上这样的文章太泛滥了。<br />
首先我要介绍和推荐的是微软自己出的Visual Web Developer，免费产品，功能还蛮不错，再者就是收费产品IE WebDeveloper，这个其实我还是蛮喜欢的，网上破解/注册版一片，我就不多说。其他的还有IEDevToolBar。</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/08/webdev-tools-lite/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>推荐5个最棒的Firebug扩展</title>
		<link>http://icyleaf.com/2008/07/the-5-best-firebug-extensions/</link>
		<comments>http://icyleaf.com/2008/07/the-5-best-firebug-extensions/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 02:53:30 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[网络开发]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[FireFox-Plugins]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=218</guid>
		<description><![CDATA[原文翻译自：The 5 Best Firebug Extensions 众所周知，Firefox浏览器外加Firebug插件是互联网开发的最佳平台和调试工具。与此同时，Firebug最人性化的地方还是可以再做插件扩展，下面将介绍的是WebMonkey推荐的5款最棒的Firebug扩展。（安装下面插件的之前必须先安装Firebug插件） 1. YSlow YSlow（why slow）是由Yahoo开发者团队发布的一款基于Firebug的插件，插件遵循雅虎10条网站开发的军规评测网页效率。这里推荐一篇文章《如何提高网页的效率（下篇）——Use YSlow to know why your web Slow》。 2. Firecookie Firecookie可以随时查看当前网页的所有变化的Cookies信息，同时还可以从firebug的面板设置是否接受或拒绝cookies信息，同时配合Firefox3的页面信息功能使用效果尤佳。Web Developer插件也有类似的功能。 3. FirePHP FirePHP的PHP调试信息都是通过在HTTP头里面添加“X-FirePHP-Data”信息串来标识，不会直接输出到页面上，这样也就避免对php正常输出产生影响。不过调试的时候需要加载一个FirePHP的库文件。如何使用大家可以参加这篇文章：《Debugging PHP with Firebug and FirePHP》这个也是我今天才找到的，里面的英文不是很难懂。 4. Pixel Perfect Pixel Perfect是专门为做设计的朋友准备，经过我的测试明白了它的用途，它可以添加图片到当前的页面上面，同时可以调整图片的透明度和位置，以方便调试网站的设计，我想光凭我说还是很难明白，大家看下官方的视频演示吧。 5. Rainbow Rainbow是一款使得JavaScript语法高亮的插件，因此此插件被命名为彩虹（Rainbow），默认的Javascript变量是绿色，保留字是蓝色，当然如果你不喜欢，你还可以随时更改，通过官方的颜色库可以改变，不过目前只有4种配色。 如果你对Firebug的插件有兴趣的话，可以参见Jan Odvarko列出来的Friebug的插件清单。当然，您也可以自己编写FIrebug插件。]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.webmonkey.com/blog/The_5_Best_Firebug_Extensions" target="_blank"></a><img src="http://blog.iyi.cn/start/2007/04/30/391953301_2101c534f2.jpg" alt="firebug" /><br />
原文翻译自：<a href="http://www.webmonkey.com/blog/The_5_Best_Firebug_Extensions" target="_blank">The 5 Best Firebug Extensions</a></p>
<p>众所周知，Firefox浏览器外加Firebug插件是互联网开发的最佳平台和调试工具。与此同时，Firebug最人性化的地方还是可以再做插件扩展，下面将介绍的是<a href="http://www.webmonkey.com" target="_blank">WebMonkey</a>推荐的5款最棒的Firebug扩展。（安装下面插件的之前必须先安装<a href="https://addons.mozilla.org/en-US/firefox/addon/5369" target="_self">Firebug</a>插件）<span id="more-218"></span></p>
<p><strong>1. </strong><strong><a href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a></strong><br />
<img src="http://us.i1.yimg.com/us.yimg.com/i/rt/yslow/perfview.png" alt="yslow" width="500" height="300" /></p>
<p>YSlow（why slow）是由<a title="Yahoo开发者团队" href="http://developer.yahoo.com/" target="_blank">Yahoo开发者团队</a>发布的一款基于Firebug的插件，插件遵循雅虎<a href="http://developer.yahoo.com/performance/index.html#rules" target="_self">10条网站开发的军规</a>评测网页效率。这里推荐一篇文章《<a href="http://www.cnblogs.com/JustinYoung/archive/2007/11/28/speeding-up-web-site-yslow.html" target="_blank">如何提高网页的效率（下篇）——Use YSlow to know why your web Slow</a>》。</p>
<p><strong>2. <a href="https://addons.mozilla.org/en-US/firefox/addon/6683" target="_blank">Firecookie</a></strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Firecookie.png" alt="Firecookie shows list of cookies in Firebug" width="500" height="128" /></p>
<p>Firecookie可以随时查看当前网页的所有变化的Cookies信息，同时还可以从firebug的面板设置是否接受或拒绝cookies信息，同时配合Firefox3的页面信息功能使用效果尤佳。<a href="https://addons.mozilla.org/firefox/addon/60" target="_self">Web Developer</a>插件也有类似的功能。</p>
<p><strong>3. <a href="https://addons.mozilla.org/en-US/firefox/addon/6149" target="_blank">FirePHP</a></strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Firephp.png" alt="FirePHP: PHP debugging in Firebug" /></p>
<p>FirePHP的PHP调试信息都是通过在HTTP头里面添加“X-FirePHP-Data”信息串来标识，不会直接输出到页面上，这样也就避免对php正常输出产生影响。不过调试的时候需要加载一个FirePHP的库文件。如何使用大家可以参加这篇文章：《<a title="Permanent Link: Debugging PHP with Firebug and FirePHP" href="http://www.developertutorials.com/blog/php/debugging-php-with-firebug-and-firephp-365/" target="_blank">Debugging PHP with Firebug and FirePHP</a>》这个也是我今天才找到的，里面的英文不是很难懂。</p>
<p><strong>4. <a href="https://addons.mozilla.org/en-US/firefox/addon/7943" target="_blank">Pixel Perfect</a></strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Pixelperfect.png" alt="Pixel Perfect help you be just that" /></p>
<p>Pixel Perfect是专门为做设计的朋友准备，经过我的测试明白了它的用途，它可以添加图片到当前的页面上面，同时可以调整图片的透明度和位置，以方便调试网站的设计，我想光凭我说还是很难明白，大家看下官方的<a href="http://www.pixelperfectplugin.com/" target="_blank">视频演示</a>吧。</p>
<p><strong>5. Rainbow</strong><br />
<img class="full" src="http://howto.wired.com/mediawiki/images/Rainbox-firebug.png" alt="Rainbow adds colors to your code" /></p>
<p>Rainbow是一款使得JavaScript语法高亮的插件，因此此插件被命名为彩虹（Rainbow），默认的Javascript变量是绿色，保留字是蓝色，当然如果你不喜欢，你还可以随时更改，通过官方的<a href="http://xrefresh.com/presets" target="_blank">颜色库</a>可以改变，不过目前只有4种配色。</p>
<p>如果你对Firebug的插件有兴趣的话，可以参见Jan Odvarko列出来的Friebug的<a href="http://www.softwareishard.com/blog/firebug/list-of-firebug-extensions/" target="_blank">插件清单</a>。当然，您也可以<a href="http://www.webmonkey.com/blog/How_to_Create_a_Firebug_Extension" target="_blank">自己编写FIrebug插件</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/07/the-5-best-firebug-extensions/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>编写即运行：JavaScript在线版</title>
		<link>http://icyleaf.com/2008/06/obsessing/</link>
		<comments>http://icyleaf.com/2008/06/obsessing/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 01:34:01 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Webware]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=208</guid>
		<description><![CDATA[Obsessing 是一个刚发布的在线javascript编辑器，最大的特点就在于编写后，点击顶部的“Run”按钮，就能运行你做编写的Javascript代码，而且在“Run”按钮的右边还有一个代码的差错功能，通过下面的截图也能看到。这个服务提供用户注册，注册之后享受的功能会更多，打开，保存，导入，导出&#8230;.. 不过目前还处于一个测试预览阶段，可能会有一些bug存在，例如你编写：alert(&#8220;Hello World&#8221;);之后就会不断的弹出内容是“Hello World”的提示框&#8230;. 整体的界面很不错，我需要向它学习，努力争取把代码墙完善的更好:)]]></description>
			<content:encoded><![CDATA[<p><a href="http://obsessing.org/" target="_self">Obsessing</a> 是一个刚发布的在线javascript编辑器，最大的特点就在于编写后，点击顶部的“Run”按钮，就能运行你做编写的Javascript代码，而且在“Run”按钮的右边还有一个代码的差错功能，通过下面的截图也能看到。这个服务提供用户注册，注册之后享受的功能会更多，打开，保存，导入，导出&#8230;..</p>
<p>不过目前还处于一个测试预览阶段，可能会有一些bug存在，例如你编写：<strong>alert(&#8220;Hello World&#8221;);</strong>之后就会不断的弹出内容是“Hello World”的提示框&#8230;.</p>
<p>整体的界面很不错，我需要向它学习，努力争取把<a href="http://codewall.cn" target="_self">代码墙</a>完善的更好:)</p>
<p><img src="http://ajaxian.com/wp-content/images/obsessing.png" alt="obsessing snap" width="520" height="364" /></p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/06/obsessing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jsvi：文本编辑器VI的在线版！</title>
		<link>http://icyleaf.com/2008/05/jsvi-web-based-vi-text-editor/</link>
		<comments>http://icyleaf.com/2008/05/jsvi-web-based-vi-text-editor/#comments</comments>
		<pubDate>Fri, 09 May 2008 02:16:30 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[Webware]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jsvi]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=189</guid>
		<description><![CDATA[Vi是Linux（Unix）下默认的文本编辑，也是非常出色的一个。在lifehacker上面评出来5个最受欢迎文本编辑之一。不过这次的主角并不是vi，而是在Webware横行的今天，一款克隆vi界面甚至是命令和操作均一样的浏览器版横空出世，那就是jsvi（我这里登录不上去，貌似被和谐掉了），这是一个用javascritp编写的，体积也不大，82kb而已。为了保证大家能够正常体验，我就无耻的把jsvi剽窃到了我的网站上面，说剽窃主要是因为其实本身它并没有提供下载，我通过源代码获取的核心文件。下面大家可以尝试下，如果你没有用过vi，可以先搜索下vi的命令都有哪些，如何进行操作，否则体验也是白搭。 体验在线版Vi：点击这里 源码下载：Download@纳米盘]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.blogsmithmedia.com/www.downloadsquad.com/media/2008/05/jvi.jpg" alt="jsvi" width="425" height="347" /><br />
<a href="http://www.vim.org/">Vi</a>是Linux（Unix）下默认的文本编辑，也是非常出色的一个。在lifehacker上面评出来5个最受欢迎文本编辑之一。不过这次的主角并不是vi，而是在Webware横行的今天，一款克隆vi界面甚至是命令和操作均一样的浏览器版横空出世，那就是<a href="http://gpl.internetconnection.net/vi/" target="_self">jsvi</a>（我这里登录不上去，貌似被和谐掉了），这是一个用javascritp编写的，体积也不大，82kb而已。为了保证大家能够正常体验，我就无耻的把jsvi剽窃到了我的网站上面，说剽窃主要是因为其实本身它并没有提供下载，我通过源代码获取的核心文件。下面大家可以尝试下，如果你没有用过vi，可以先搜索下vi的命令都有哪些，如何进行操作，否则体验也是白搭。<br />
体验在线版Vi：<a href="http://www.icyleaf.cn/labs/vi/" target="_self">点击这里</a><br />
源码下载：<a href="http://www.namipan.com/d/vi-online-text-editor.zip/b2484c24722c71a0b43ea1a1c0ec4c308fa6d1eda9570000" target="_self">Download@纳米盘</a></p>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/05/jsvi-web-based-vi-text-editor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Pi.Debugger：随时调试你的网页代码</title>
		<link>http://icyleaf.com/2008/04/pi-debugger/</link>
		<comments>http://icyleaf.com/2008/04/pi-debugger/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 03:18:21 +0000</pubDate>
		<dc:creator>icyleaf</dc:creator>
				<category><![CDATA[网络开发]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Pi.Debugger]]></category>

		<guid isPermaLink="false">http://www.icyleaf.cn/?p=181</guid>
		<description><![CDATA[pi.debugger 是用JavaScript编写而成的网页代码调试工具，其界面类似于FireFox浏览器的FireBug，如下图： 而且这个JavaScript不依赖任何的库，为压缩在整个的体积也才40Kb而已，适用于IE6/IE7,OPERA 9.2, WEBKIT/525.1, FIREFOX 2浏览器平台，这个工具可谓给非Firefox的开发者提供了便利和时间。那么我们就亲自操作一下他吧～ 效果是不是很酷，也也方便，而且安装起来也非常的简单，只需要在网页&#60;head&#62;&#60;/head&#62;之间加入如下代码即可：]]></description>
			<content:encoded><![CDATA[<p><a id="About" href="http://code.google.com/p/pi-js/" target="_self">pi.debugger</a> 是用JavaScript编写而成的网页代码调试工具，其界面类似于FireFox浏览器的FireBug，如下图：<br />
<img src="http://ajaxian.com/wp-content/images/pidebugger.png" alt="pi.debugger" width="450" height="400" /></p>
<p>而且这个JavaScript不依赖任何的库，为压缩在整个的体积也才40Kb而已，适用于IE6/IE7,OPERA 9.2, WEBKIT/525.1, FIREFOX 2浏览器平台，这个工具可谓给非Firefox的开发者提供了便利和时间。<a href="http://kodfabrik.com/app/pi.debugger" target="_self">那么我们就亲自操作一下他吧</a>～</p>
<p>效果是不是很酷，也也方便，而且安装起来也非常的简单，只需要在网页&lt;head&gt;&lt;/head&gt;之间加入如下代码即可：</p>
<pre lang="html4strict" line="1" colla="+">
<script type="text/javascript" src="http://pi-js.googlecode.com/files/debugger.js"></script>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://icyleaf.com/2008/04/pi-debugger/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

