<?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://www.zhangjingwei.com/archives/category/web-developer/javascript-web-developer/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zhangjingwei.com</link>
	<description></description>
	<lastBuildDate>Fri, 14 Oct 2011 09:01:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>jQuery Select</title>
		<link>http://www.zhangjingwei.com/archives/jquery-select/</link>
		<comments>http://www.zhangjingwei.com/archives/jquery-select/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 16:03:35 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1762</guid>
		<description><![CDATA[TextMate下的中文看起来实在是费劲，所以就都去掉了。 使用很简单，select还是按照原来的BOM去写，然后构造对应DOM的jQuery对象，再调用selectinput方法即可。 BTW：下拉菜单的样式需要自己去写一下，对应的样式参数在conf.css这个对象下。 /* * Select zhangjingwei * Released under the MIT, BSD, and GPL Licenses. */ &#40;function &#40;$&#41; &#123; &#160; $.tools = $.tools &#124;&#124; &#123; version: '1.3' &#125;; &#160; var instances = &#91;&#93;, tool = $.tools.selectinput = &#123; conf: &#123; offset: 0, // 弹出菜单偏移量 trigger: false, // 默认触发 css: &#123; // ids root: 0, [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/jquery-select/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>javascript 序列化</title>
		<link>http://www.zhangjingwei.com/archives/javascript-serialize/</link>
		<comments>http://www.zhangjingwei.com/archives/javascript-serialize/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 05:58:31 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1749</guid>
		<description><![CDATA[类似php中的serialize方法 BTW:当数据类型是null的时候,由于使用typeof 进行验证,所以会出现问题.(typeof null == &#8220;object&#8221;) // true function serialize&#40;_obj&#41; &#123; // Let Gecko browsers do this the easy way if &#40;typeof _obj.toSource !== 'undefined' &#38;&#38; typeof _obj.callee === 'undefined'&#41; &#123; return _obj.toSource&#40;&#41;; &#125; &#160; // Other browsers must do it the hard way switch &#40;typeof _obj&#41; &#123; // numbers, booleans, and functions are trivial: [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/javascript-serialize/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>构造函数(constructor)的超类</title>
		<link>http://www.zhangjingwei.com/archives/%e6%9e%84%e9%80%a0%e5%87%bd%e6%95%b0constructor%e7%9a%84%e8%b6%85%e7%b1%bb/</link>
		<comments>http://www.zhangjingwei.com/archives/%e6%9e%84%e9%80%a0%e5%87%bd%e6%95%b0constructor%e7%9a%84%e8%b6%85%e7%b1%bb/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 16:14:37 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1712</guid>
		<description><![CDATA[function test1&#40; name &#41;&#123; this.name = name; &#125; &#160; function test2&#40; name &#41;&#123; test1.call&#40;this,name&#41;; this.say = function&#40;&#41;&#123;&#125; &#125; &#160; test2.prototype = new test1; &#160; var t = new test2&#40;&#34;nihao&#34;&#41;; &#160; console.log&#40;t&#41;; console.log&#40;t.constructor&#41;; t的constructor说明了t的构造函数是test1，而不是test2。 这是因为t的constructor实际上是test2.prototype的constructor，而test2.prototype = new test1;因此test2test2.prototype的constructor属性就指向到了test1的prototype.constructor上test1.prototype的constructor上，也就是test1。 罗里吧嗦的，这标题起的还挺唬人的~呵呵]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/%e6%9e%84%e9%80%a0%e5%87%bd%e6%95%b0constructor%e7%9a%84%e8%b6%85%e7%b1%bb/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript File API for Mozilla</title>
		<link>http://www.zhangjingwei.com/archives/javascript-file-api-for-mozilla/</link>
		<comments>http://www.zhangjingwei.com/archives/javascript-file-api-for-mozilla/#comments</comments>
		<pubDate>Thu, 24 Mar 2011 15:30:46 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1705</guid>
		<description><![CDATA[1. 文件读取函数 readAsBinaryString() 读取文件内容，读取结果为一个 binary string。文件每一个 byte 会被表示为一个 [0..255] 区间内的整数。函数接受一个 File 对象作为参数。 readAsText() 读取文件内容，读取结果为一串代表文件内容的文本。函数接受一个 File 对象以及文本编码名称作为参数。 readAsDataURL 读取文件内容，读取结果为一个 data: 的 URL。DataURL 由 RFC2397 定义，具体可以参考 http://www.ietf.org/rfc/rfc2397.txt。 2. 文件读取事件 Onloadstart 文件读取开始时触发。 Progress 当读取进行中时定时触发。事件参数中会含有已读取总数据量。 Abort 当读取被中止时触发。 Error 当读取出错时触发。 Load 当读取成功完成时触发。 Loadend 当读取完成时，无论成功或者失败都会触发。 &#60;form name=&#34;demoForm&#34; id=&#34;demoForm&#34; method=&#34;post&#34; enctype=&#34;multipart/form-data&#34; onsubmit=&#34;uploadAndSubmit();return false;&#34;&#62; &#60;p&#62;Upload File: &#60;input type=&#34;file&#34; name=&#34;file&#34; /&#62;&#60;/p&#62; &#60;p&#62;&#60;input type=&#34;submit&#34; value=&#34;Submit&#34; [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/javascript-file-api-for-mozilla/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery inViewport</title>
		<link>http://www.zhangjingwei.com/archives/jquery-inviewport/</link>
		<comments>http://www.zhangjingwei.com/archives/jquery-inviewport/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 15:33:40 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[inViewport]]></category>
		<category><![CDATA[lazyload]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1690</guid>
		<description><![CDATA[晚上在微博上“拔赤”写了个lazyload插件，发现其中用到一个很有意思的方法&#8221;div.inViewportRegion()&#8221;，字面意思就是在可视区域内。 在网上找了找，发现这是YUI提供的一个组件，觉得很有意思。 http://gillserver.com/yui/api/dom-region.js.html 如果jQ里面也包含类似的方法，可以做很多事，于是GG了一下，发现国外的同学写过这种选择器，代码表现上更直观。 代码如下： &#40;function&#40;$&#41; &#123; &#160; $.belowthefold = function&#40;element, settings&#41; &#123; var fold = $&#40;window&#41;.height&#40;&#41; + $&#40;window&#41;.scrollTop&#40;&#41;; return fold &#60; = $&#40;element&#41;.offset&#40;&#41;.top - settings.threshold; &#125;; &#160; $.abovethetop = function&#40;element, settings&#41; &#123; var top = $&#40;window&#41;.scrollTop&#40;&#41;; return top &#62;= $&#40;element&#41;.offset&#40;&#41;.top + $&#40;element&#41;.height&#40;&#41; - settings.threshold; &#125;; &#160; $.rightofscreen = function&#40;element, settings&#41; &#123; var fold = [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/jquery-inviewport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>js ip地址转真实地址</title>
		<link>http://www.zhangjingwei.com/archives/js-get-ipaddress/</link>
		<comments>http://www.zhangjingwei.com/archives/js-get-ipaddress/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 16:43:31 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1681</guid>
		<description><![CDATA[新浪，有道，ip138提供了将ip地址转换为真实地址的接口，这个控件的作用就是将这些接口封装起来，实现js将ip地址转换为真实地址。 使用方法很简单，如有html &#60;div class=&#34;query_ip&#34;&#62;202.103.22.1&#60;/div&#62; 调用如下js $&#40;&#34;.query_ip&#34;&#41;.getaddress&#40;&#123; type:&#34;youdao&#34; // 支持youdao&#124;sina&#124;ip138 (有道速度快且准确，新浪快，ip138较慢) &#125;&#41;; 则将HTML修改为 &#60;div class=&#34;query_ip&#34;&#62;202.103.22.1 湖北省十堰市 东风电信&#60;/div&#62; 具体JS源码如下 &#40;function&#40;&#41;&#123; /* * 默认配置 */ var domainAddressConf = &#123; source : &#123; &#34;sina&#34;:&#34;http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&#38;ip=&#34;, &#34;youdao&#34;:&#34;http://youliao.sinaapp.com/app/getip.php?callback=?&#38;type=youdao&#38;ip=&#34;, &#34;ip138&#34;:&#34;http://youliao.sinaapp.com/app/getip.php?callback=?&#38;ip=&#34; &#125;, type : null, charset : &#34;gb2312&#34; &#125; &#160; function getAddress&#40; self,conf &#41;&#123; var type = conf.type &#124;&#124; &#34;youdao&#34;, ipadress = conf.source&#91;type&#93; + [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/js-get-ipaddress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>无限级菜单</title>
		<link>http://www.zhangjingwei.com/archives/%e6%97%a0%e9%99%90%e7%ba%a7%e8%8f%9c%e5%8d%95/</link>
		<comments>http://www.zhangjingwei.com/archives/%e6%97%a0%e9%99%90%e7%ba%a7%e8%8f%9c%e5%8d%95/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 11:38:39 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1672</guid>
		<description><![CDATA[随手写了一个，实现不复杂，只支持动态树。 如果要用的话，获取数据哪里做下简单的修改就可以了，这只是一个Demo。 &#40;function&#40;$&#41;&#123; &#160; var jtree = &#123; treeid : &#34;jquery_tree_resource&#34;, treeclass : &#34;tree&#34;, idname : &#34;id&#34;, classname : &#34;name&#34;, optionname : &#34;options&#34;, openclass: &#34;switch_roots_open&#34;, closeclass: &#34;switch_roots_close&#34;, treeurl: &#34;&#34; &#125; &#160; // constructor function tree&#40;root, conf&#41; &#123; var self = root, cache = &#34;&#34;, // HTML缓存区 current = null, // 当前节点对象 counter = 0; // [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/%e6%97%a0%e9%99%90%e7%ba%a7%e8%8f%9c%e5%8d%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>运算符的特殊行为</title>
		<link>http://www.zhangjingwei.com/archives/%e8%bf%90%e7%ae%97%e7%ac%a6%e7%9a%84%e7%89%b9%e6%ae%8a%e8%a1%8c%e4%b8%ba/</link>
		<comments>http://www.zhangjingwei.com/archives/%e8%bf%90%e7%ae%97%e7%ac%a6%e7%9a%84%e7%89%b9%e6%ae%8a%e8%a1%8c%e4%b8%ba/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 07:40:34 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[运算符]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1663</guid>
		<description><![CDATA[加法运算符: 运算数是NaN、undefined，则结果为NaN Infinity加Infinity，结果为Infinity -Infinity加-Infinity，结果为-Infinity Infinity加-Infinity，结果为NaN 减法运算符： 运算数是NaN、undefined时，结果为NaN Infinity减Infinity，结果为NaN -Infinity减-Infinity，结果为NaN Infinity减-Infinity，结果为Infinity -Infinity减Infinity，结果为-Infinity 乘法运算符: 运算数是NaN，结果为NaN Infinity乘以0，结果为NaN 除法运算符: 运算数是NaN，结果为NaN Infinity除Infinity，结果为NaN 任何数除Infinity，结果为Infinity 0除非无穷大的数（Infinity），结果为是NaN 取模运算符: 运算数是NaN，结果为NaN 除数是0或者被除数是Infinity，结果为NaN Infinity除Infinity，结果为NaN 除数是Infinity，结果为被除数 被除数是0，结果为0]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/%e8%bf%90%e7%ae%97%e7%ac%a6%e7%9a%84%e7%89%b9%e6%ae%8a%e8%a1%8c%e4%b8%ba/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>js下的多态</title>
		<link>http://www.zhangjingwei.com/archives/polymorphic/</link>
		<comments>http://www.zhangjingwei.com/archives/polymorphic/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 16:34:01 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1633</guid>
		<description><![CDATA[多态性就是多种表现形式，具体来说，可以用&#8221;一个对外接口，多个内在实现方法&#8220;表示。举一个例子，计算机中的堆栈可以存储各种格式的数据，包括整型，浮点或字符。不管存储的是何种数据，堆栈的算法实现是一样的。针对不同的数据类型，编程人员不必手工选择，只需使用统一接口名，系统可自动选择。 百科链接 我理解了下，js下应该是这样来实现 var Car = function&#40;type&#41;&#123; return new Car&#91;type&#93;&#40;&#41;; &#125; &#160; Car.jeep = function&#40;&#41;&#123;&#125; Car.jeep.prototype = &#123; showType: function&#40;&#41;&#123; return &#34;this is jeep&#34;; &#125; &#125; &#160; Car.bus = function&#40;&#41;&#123;&#125; Car.bus.prototype = &#123; showType: function&#40;&#41;&#123; return &#34;this is bus&#34;; &#125; &#125; &#160; var jeep = new Car&#40;&#34;jeep&#34;&#41;; var bus = new Car&#40;&#34;bus&#34;&#41;; &#160; jeep.showType&#40;&#41;; // [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/polymorphic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Autocomplete plugin 1.2</title>
		<link>http://www.zhangjingwei.com/archives/jquery-autocomplete-plugin-1-2/</link>
		<comments>http://www.zhangjingwei.com/archives/jquery-autocomplete-plugin-1-2/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 05:20:29 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1621</guid>
		<description><![CDATA[修正因网络延迟而导致的显示错误 增加关键词高亮功能 修正了部分代码 使用固定的回调函数 插件代码： &#40;function&#40;$&#41;&#123; $.tools = $.tools &#124;&#124; &#123;version: '1.2'&#125;; $.tools.suggest = &#123;&#125;; $.tools.suggest.defaults = &#123; url : null, params : null, delay : 100, cache : true, formId : '#search_form', focus:null &#125; $.tools.suggest.borderKey = &#123; UP: 38, DOWN: 40, TAB: 9, ESC: 27, ENTER:13 &#125; &#160; $.fn.suggest=function&#40;options,fn&#41;&#123; var options,key = $.tools.suggest.borderKey; if&#40;$.isFunction&#40;options&#41;&#41;&#123; [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/jquery-autocomplete-plugin-1-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>dojo 中对象扩展与原型继承的实现</title>
		<link>http://www.zhangjingwei.com/archives/dojo-prototypal-inheritance/</link>
		<comments>http://www.zhangjingwei.com/archives/dojo-prototypal-inheritance/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 16:02:47 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[mixin]]></category>
		<category><![CDATA[_mixin]]></category>
		<category><![CDATA[继承]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1607</guid>
		<description><![CDATA[dojo 是一款优秀的javascript框架，通常我们可以在复杂的企业级应用中看到它的身影。 dojo 提供了两个方法来实现继承 dojo.mixin、dojo.extend dojo.mixin 作用在对象上，它负责扩展一个对象 dojo.extend 作用在实例上，他负责扩展实例（本质上是扩展产生实例的类） 而这两个方法的底层实现是dojo._mixin。 因此，我将这一部分抽出，并进行分析。 &#40;function&#40;&#41;&#123; // 创建一个命名空间 var dojo = &#123;&#125;; // 初始化一些变量 var extraNames, extraLen, empty = &#123;&#125;; // 判断是否为ie浏览器，如果不是则将 dojo._extraNames 设为空数组 // 如果是则将其设置为[&#34;hasOwnProperty&#34;, &#34;valueOf&#34;, &#34;isPrototypeOf&#34;, // &#34;propertyIsEnumerable&#34;, &#34;toLocaleString&#34;, &#34;toString&#34;, &#34;constructor&#34;] for&#40;var i in &#123;toString: 1&#125;&#41;&#123; extraNames = &#91;&#93;; break; &#125; dojo._extraNames = extraNames = extraNames &#124;&#124; [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/dojo-prototypal-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>对象中的公有方法、私有方法、特权方法</title>
		<link>http://www.zhangjingwei.com/archives/private-members/</link>
		<comments>http://www.zhangjingwei.com/archives/private-members/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 04:05:14 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[公共]]></category>
		<category><![CDATA[特权]]></category>
		<category><![CDATA[私有]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1591</guid>
		<description><![CDATA[了解如何创建一个对象的时候，我们就需要给这个对象增加方法和属性。 在其他的书籍教程中，我们经常看到各种名称的方法，例如静态方法、实例方法等等，开始我查阅的时候就被这些说法搞的稀里糊涂的，于是自己总结了下，若有错误，还请指出。 1、静态方法和属性 静态方法既只允许父类调用，其他的实例均无法访问和调用的方法和属性。 var user = function&#40;age&#41;&#123; // 变量age 是user对象的私有属性 var age = age; &#125; &#160; // user.age 是user对象的静态方法 user.age = function&#40;&#41;&#123; return this.age; &#125; &#160; // 当我们将user对象实例化的时候 // zhangsan 无法使用 user 对象中 // 的 age方法 var zhangsan = new user&#40;18&#41;; &#160; // 实例中没有继承user对象的age方法 alert&#40;!!zhangsan.age == false&#41;; 2、公共方法 公共方法既依此父类生成的所有实例均可以使用的方法。 var user = function&#40;name,age&#41;&#123; // [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/private-members/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery 源码分析（3）</title>
		<link>http://www.zhangjingwei.com/archives/jquery-analysis-code-3/</link>
		<comments>http://www.zhangjingwei.com/archives/jquery-analysis-code-3/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 20:26:27 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[源码分析]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1569</guid>
		<description><![CDATA[上次我们分析了jQuery对象的构建方法以及如何去扩展jQuery对象的方法extend()。 这次让我们先看看jQuery本身还有那些静态属性和方法实例方法。 需要注意的是，这里定义的所有jQuery的静态属性/方法实例方法也是是jQuery对象的静态属性/方法实例方法。 jQuery.fn = jQuery.prototype = &#123; init: function&#40; selector, context &#41; &#123; // code here ... &#125;, &#160; // 为所有jQuery对象初始化一个空的选择器 selector: &#34;&#34;, &#160; // The current version of jQuery being used jquery: &#34;1.4.2&#34;, &#160; // 初始化 jQuery 对象长度（jQuery含有多少个DOM对象，长度就是几） length: 0, &#160; // 获取jQuery.length属性的方法 size: function&#40;&#41; &#123; return this.length; &#125;, &#160; // 将this对象转为数组 //注意，这里的slice方法并不是Array.slice()，而是jQuery.slice() [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/jquery-analysis-code-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 源码分析（2）</title>
		<link>http://www.zhangjingwei.com/archives/jquery-analysis-code-2/</link>
		<comments>http://www.zhangjingwei.com/archives/jquery-analysis-code-2/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 04:07:32 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[源码分析]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1549</guid>
		<description><![CDATA[上文我们提到了jQuery框架中的一个重要功能，扩展方法。 当我们使用new运算法实例化一个对象后，是如何对这个实例的原型再扩展方法的，因为这个实例的原型实际上是他类的原型的引用。（不知道这儿理解的是否正确） 因此当我们试图向实例化对象的原型中增加方法或者属性都是不行的。 function car&#40;&#41;&#123;&#125; &#160; car.prototype = &#123; name: function&#40;name&#41;&#123; return name; &#125; &#125; &#160; var jeep = new car&#40;&#41;; jeep.prototype = &#123; type: &#34;jeep&#34; &#125; &#160; alert&#40;jeep.name&#40;&#34;aodi&#34;&#41;&#41;; //aodi alert&#40;jeep.type&#41;; //undefined 那么当我们需要扩展jQuery对象或者jQuery中的时候怎么办？ 使用 jQuery.fn.extedn()、jQuery.extend()方法。 1、扩展jQuery静态方法 jQuery.extend&#40;&#123; max: function&#40;a, b&#41; &#123; return a &#62; b ? a : b; &#125; &#125;&#41;; &#160; jQuery.max&#40;5,4&#41; //5 2、给jQuery对象扩展方法 [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/jquery-analysis-code-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery 源码分析（1）</title>
		<link>http://www.zhangjingwei.com/archives/jquery-analysis-code-1/</link>
		<comments>http://www.zhangjingwei.com/archives/jquery-analysis-code-1/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 15:20:12 +0000</pubDate>
		<dc:creator>张经纬</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[源码分析]]></category>

		<guid isPermaLink="false">http://www.zhangjingwei.com/?p=1533</guid>
		<description><![CDATA[jQuery 是一款开源的，最流行的，面向对象的Javascript框架，因为平时经常使用，也就萌生了阅读源码的想法，尝试着去分析一下，如果有问题，还请大家指点。 阅读 jQuery 源码之前，必须要了解 jQuery 的工作机制，在我看来，实际上 jQuery 是一个标准的以面向对象的程序结构，jQuery 本身是一个类，而每一个我们构建的 jQuery 对象则是这个类实例。 因此我从如下两个方法来入手 1、如何构造 jQuery 对象 2、jQuery对象的继承 1、如何构造 jQuery 对象 jQuery 提供了四种封装jQuery对象的方法，分别是 DOMElement HTML strings TAG expr, $(&#8230;) 这四种方法的调用如下。 elem = document.getElementsByTagName&#40;&#34;div&#34;&#41;; elem = $&#40;elem&#41;; var elem = $&#40;&#34;&#60;p&#62;hello&#60;/p&#62;&#34;&#41;; var elem = $&#40;&#34;div&#34;&#41;; var elem = $&#40;&#34;body &#62; div&#34;&#41;; 通过这些方法，就生成一个jQuery对象。 那么，在jQuery内部，是如何去封装这个对象的呢？ 看代码 var jQuery = [...]]]></description>
		<wfw:commentRss>http://www.zhangjingwei.com/archives/jquery-analysis-code-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

