<?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>omiga &#187; jQuery</title>
	<atom:link href="http://omiga.org/blog/archives/tag/jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://omiga.org/blog</link>
	<description>简单就好</description>
	<lastBuildDate>Mon, 06 Feb 2012 17:39:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>JavaScript中的property和attribute</title>
		<link>http://omiga.org/blog/archives/2055</link>
		<comments>http://omiga.org/blog/archives/2055#comments</comments>
		<pubDate>Wed, 12 Oct 2011 09:41:19 +0000</pubDate>
		<dc:creator>omiga</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[attr]]></category>
		<category><![CDATA[attribute]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[prop]]></category>
		<category><![CDATA[property]]></category>

		<guid isPermaLink="false">http://omiga.org/blog/?p=2055</guid>
		<description><![CDATA[首先看看这两个单词的英文释义（来自有道词典）。先是property： property ['prɔpəti] n. 性质，性能；财产；所有权 英英释义： any area set aside for a particular purpose “the president was concerned about the property across from the White House” 同义词：place something owned; any tangible or intangible possession that is owned by someone “that hat is my property”; ” he is a man of property” 同义词：belongings &#124; holding &#124; material possession a basic or essential attribute [...]]]></description>
			<content:encoded><![CDATA[<p>首先看看这两个单词的英文释义（来自有道词典）。先是property：</p>
<blockquote><p>property ['prɔpəti]</p>
<p>n. 性质，性能；财产；所有权</p>
<p>英英释义：</p>
<ol>
<li>any area set aside for a particular purpose <em>“the president was concerned about the property across from the White House”<br />
</em>同义词：<a href="http://dict.youdao.com/search?q=place&amp;tab=eng&amp;keyfrom=dict.eesy">place</a></li>
<li>something owned; any tangible or intangible possession that is owned by someone <em>“that hat is my property”; ” he is a man of property”<br />
</em>同义词：<a href="http://dict.youdao.com/search?q=belongings&amp;tab=eng&amp;keyfrom=dict.eesy">belongings</a> | <a href="http://dict.youdao.com/search?q=+holding&amp;tab=eng&amp;keyfrom=dict.eesy">holding</a> | <a href="http://dict.youdao.com/search?q=+material+possession&amp;tab=eng&amp;keyfrom=dict.eesy">material possession</a></li>
<li>a basic or essential attribute shared by all members of a class</li>
<li>a construct whereby objects or individuals can be distinguished <em>“self-confidence is not an endearing property”<br />
</em>同义词：<a href="http://dict.youdao.com/search?q=attribute&amp;tab=eng&amp;keyfrom=dict.eesy">attribute</a> | <a href="http://dict.youdao.com/search?q=+dimension&amp;tab=eng&amp;keyfrom=dict.eesy">dimension</a></li>
<li>any movable articles or objects used on the set of a play or movie<br />
同义词：<a href="http://dict.youdao.com/search?q=prop&amp;tab=eng&amp;keyfrom=dict.eesy">prop</a></li>
</ol>
</blockquote>
<p>重点看2、3、4条。</p>
<p>再看attribute：</p>
<blockquote><p>attribute [ə'tribju:t, 'ætribju:t]</p>
<p>n. 属性；特质<br />
vt. 归属；把…归于</p>
<p>英英释义：</p>
<p>n.</p>
<ol>
<li>a construct whereby objects or individuals can be distinguished<br />
同义词：<a href="http://dict.youdao.com/search?q=property&amp;tab=eng&amp;keyfrom=dict.eesy">property</a> | <a href="http://dict.youdao.com/search?q=+dimension&amp;tab=eng&amp;keyfrom=dict.eesy">dimension</a></li>
<li>an abstraction belonging to or characteristic of an entity</li>
</ol>
<p>v.</p>
<ol>
<li>attribute or credit to ”We attributed this quotation to Shakespeare”<br />
同义词：<a href="http://dict.youdao.com/search?q=impute&amp;tab=eng&amp;keyfrom=dict.eesy">impute</a> | <a href="http://dict.youdao.com/search?q=+ascribe&amp;tab=eng&amp;keyfrom=dict.eesy">ascribe</a> | <a href="http://dict.youdao.com/search?q=+assign&amp;tab=eng&amp;keyfrom=dict.eesy">assign</a></li>
<li>decide as to where something belongs in a scheme<br />
同义词：<a href="http://dict.youdao.com/search?q=assign&amp;tab=eng&amp;keyfrom=dict.eesy">assign</a></li>
</ol>
</blockquote>
<p>property，attribute都作“属性”解，但是attribute更强调区别于其他事物的特质/特性，而在<a title="Attribute和Property之区别" href="http://www.blogjava.net/wxb_nudt/archive/2005/06/20/6409.html" target="_blank">这篇文章中</a>也提交到<strong>attribute是property的子集</strong>。</p>
<p>而在JavaScript中，property和attribute更是有明显的区别。众所周知，setAttribute是为DOM节点设置/添加属性的标准方法：</p>
<pre>var ele = document.getElementById("my_ele");
ele.setAttribute("title","it's my element");</pre>
<p>但很多时候我们也这样写：</p>
<pre>ele.title = "it's my element";</pre>
<p>如果不出什么意外，他们都运行的很好，它们似乎毫无区别？而且通常情况下我们还想获取到我们设置的“属性”，我们也很爱这样写：</p>
<pre>alert(ele.title);</pre>
<p>这时候，你便会遇到问题，如果你所设置的属性属于DOM元素本身所具有的标准属性，不管是通过ele.setAttribute还是ele.title的方式设置，都能正常获取。但是如果设置的属性不是标准属性，而是自定义属性呢？</p>
<p><span id="more-2055"></span></p>
<pre>ele.setAttribute('mytitle','test my title');
alert(ele.mytitle);  //undefined
alert(ele.getAttribute('mytitle'));  //'test my title'

ele.yourtitle = 'your test title';
alert(ele.getAttribute('yourtitle'));  //null
alert(ele.yourtitle);  //'your test title'</pre>
<p>通过setAttribute设置的自定义属性，只能通过标准的getAttribute方法来获取；同样通过点号方式设置的自定义属性也无法通过标准方法getAttribute来获取。在对自定义属性的处理方式上，DOM属性的标准方法和点号方法不再具有任何关联性（上诉代码在IE6-有兼容性问题，后面会继续介绍）。</p>
<p>这种设置、获取“属性”的差异性，究其根源，其实也是property与attribute的差异性所致。</p>
<p>通过点号设置的“属性”其实是设置的property，如上所说attribute是property的子集，那么点号设置的property自然无法通过只能获取attribute的getAttribute方法来获取。</p>
<div id="attachment_2223" class="wp-caption alignnone" style="width: 286px"><a href="http://omiga.org/img/prop_attr.png"><img class="size-full wp-image-2223" title="prop_attr" src="http://omiga.org/img/prop_attr.png" alt="property and attribute" width="276" height="211" /></a><p class="wp-caption-text">property and attribute</p></div>
<p>照图似乎更易理解，getAttribute无法获取到不属于attribute的property也是理所应当。但是这时候你会发现另外一个问题，通过setAttribute设置的属性，同样也应该属于property，那么为何无法通过点号获取？</p>
<p>我们换种理解，只有标准属性才可同时使用标准方法和点号方法，而对于自定义属性，标准方法和点号方法互不干扰。</p>
<div id="attachment_2225" class="wp-caption alignnone" style="width: 332px"><a href="http://omiga.org/img/prop_attr2.png"><img class="size-full wp-image-2225" title="自定义属性互不干扰" src="http://omiga.org/img/prop_attr2.png" alt="自定义属性互不干扰" width="322" height="206" /></a><p class="wp-caption-text">自定义属性互不干扰</p></div>
<p>那么，在JavaScript中<strong>attribute并不是property的子集，property与attribute仅存在交集，即标准属性</strong>，这样疑问都可得到合理的解释。</p>
<p>但在IE9-中，上诉结论并不成立。IE9-浏览器中，除了标准属性，自定义属性也是共享的，即标准方法和点号皆可读写。</p>
<p>成功设置的attribute都会体现在HTML上，通过outerHTML可以看到attribute都被添加到了相应的tag上，所以如果attribute不是字符串类型数据都会调用toString()方法进行转换。但是由于IE9-中，标准属性与自定义属性不做区分，attribute依然可以是任意类型数据，并不会调用toString()转换，非字符串attribute不会体现在HTML上，但更为严重的问题是，这样很容易就会导致<a title="ie内存泄漏" href="http://birdshome.cnblogs.com/archive/2006/05/28/IE_MemoryLeak.html" target="_blank">内存泄漏</a>。所以如果不是字符串类型的自定义属性，建议使用成熟框架中的相关方法（如jQuery中的data方法）。</p>
<h2>getAttribute与点号(.)的差异性</h2>
<p>虽然getAttribute和点号方法都能获取标准属性，但是他们对于某些属性，获取到的值存在差异性，比如href,src,value等。</p>
<pre>&lt;a href="#" id="link"&gt;Test Link&lt;/a&gt;
&lt;img src="img.png" id="image" /&gt;
&lt;input type="text" value="enter text" id="ipt" /&gt;
&lt;script&gt;
var $ = function(id){return document.getElementById(id);};
alert($('link').getAttribute('href')); //#
alert($('link').href); //fullpath/file.html#

alert($('image').getAttribute('src')) //img.png
alert($('image').src) //fullpath/img.png

alert($('ipt').getAttribute('value')) //enter text
alert($('ipt').value) //enter text
$('ipt').value = 5;
alert($('ipt').getAttribute('value')) //enter text
alert($('ipt').value) //5
&lt;/script&gt;</pre>
<p>测试可发现<strong>getAttribute获取的是元素属性的字面量，而点号获取的是计算值</strong>。</p>
<p>更多细节可查看这篇文章：<a title="Attributes and custom properties" href="http://javascript.info/tutorial/attributes-and-custom-properties" target="_blank">Attributes and custom properties</a></p>
<h1></h1>
<hr />
<p><small>© omiga for <a href="http://omiga.org/blog">omiga</a>, 2011. |
<a href="http://omiga.org/blog/archives/2055">Permalink</a> |
<a href="http://omiga.org/blog/archives/2055#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://omiga.org/blog/archives/2055&title=JavaScript中的property和attribute">del.icio.us</a>
<br/>
Post tags: <a href="http://omiga.org/blog/archives/tag/attr" rel="tag">attr</a>, <a href="http://omiga.org/blog/archives/tag/attribute" rel="tag">attribute</a>, <a href="http://omiga.org/blog/archives/tag/data" rel="tag">data</a>, <a href="http://omiga.org/blog/archives/tag/jquery" rel="tag">jQuery</a>, <a href="http://omiga.org/blog/archives/tag/prop" rel="tag">prop</a>, <a href="http://omiga.org/blog/archives/tag/property" rel="tag">property</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://omiga.org/blog/archives/2055/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery1.3:Live Events</title>
		<link>http://omiga.org/blog/archives/892</link>
		<comments>http://omiga.org/blog/archives/892#comments</comments>
		<pubDate>Fri, 16 Jan 2009 06:49:47 +0000</pubDate>
		<dc:creator>omiga</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[die]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[unbind]]></category>

		<guid isPermaLink="false">http://omiga.org/blog/?p=892</guid>
		<description><![CDATA[jQuery 1.3中新增了两个“实时”事件处理方法——live,die，用于绑定和删除事件处理函数。这两个方法与之前的bind和unbind存在明显的区别。 live( type, fn ) Added in jQuery 1.3: Binds a handler to an event (like click) for all current &#8211; and future &#8211; matched element. Can also bind custom events. bind( type, [data], fn ) Binds a handler to one or more events (like click) for each matched element. Can also bind custom events. bind只能对当前的匹配对象绑定事件处理函数，而live不但能够对当前的匹配对象绑定事件处理函数，还能够对将来的匹配对象绑定事件处理函数。 例如： $("button").bind("click",function(){ 　　$(this).after("&#60;button&#62;click [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jquery.com/" target="_blank">jQuery</a> 1.3中新增了两个“实时”事件处理方法——live,die，用于绑定和删除事件处理函数。这两个方法与之前的bind和unbind存在明显的区别。</p>
<blockquote><p><strong><strong class="selflink">live</strong>( type, fn ) </strong></p>
<p>Added in jQuery 1.3<strong>:</strong> Binds a handler to an event (like click) for all current &#8211; and <strong>future</strong> &#8211; matched element.  Can also bind custom events.</p></blockquote>
<blockquote><p><strong><strong class="selflink">bind</strong>( type, <span class="optional">[</span>data<span class="optional">]</span>, fn ) </strong></p>
<p>Binds a handler to one or more events (like click) for each matched element.  Can also bind custom events.</p></blockquote>
<p>bind只能对当前的匹配对象绑定事件处理函数，而live不但能够对当前的匹配对象绑定事件处理函数，还能够对将来的匹配对象绑定事件处理函数。</p>
<p>例如：</p>
<pre>$("button").bind("click",function(){
　　$(this).after("&lt;button&gt;click me&lt;/button&gt;");
　}
);</pre>
<p>使用bind无法对后面创建的对象进行“click”事件处理函数的绑定。</p>
<p>而使用live则完全可以对将来的匹配对象进行事件处理函数的绑定：</p>
<pre>$("div").live("click",function(){
　　$(this).after("&lt;div&gt;div:click me&lt;/div&gt;");
　}
)</pre>
<p><a href="http://omiga.org/lab/live_events.html" target="_blank">查看Demo</a></p>
<p>附：<a href="http://omiga.org/jquery/" target="_blank">jQuery1.3中文API</a></p>
<hr />
<p><small>© omiga for <a href="http://omiga.org/blog">omiga</a>, 2009. |
<a href="http://omiga.org/blog/archives/892">Permalink</a> |
<a href="http://omiga.org/blog/archives/892#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://omiga.org/blog/archives/892&title=jQuery1.3:Live Events">del.icio.us</a>
<br/>
Post tags: <a href="http://omiga.org/blog/archives/tag/bind" rel="tag">bind</a>, <a href="http://omiga.org/blog/archives/tag/die" rel="tag">die</a>, <a href="http://omiga.org/blog/archives/tag/jquery" rel="tag">jQuery</a>, <a href="http://omiga.org/blog/archives/tag/live" rel="tag">live</a>, <a href="http://omiga.org/blog/archives/tag/unbind" rel="tag">unbind</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://omiga.org/blog/archives/892/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery中一些不常用的方法属性</title>
		<link>http://omiga.org/blog/archives/255</link>
		<comments>http://omiga.org/blog/archives/255#comments</comments>
		<pubDate>Wed, 20 Aug 2008 04:22:25 +0000</pubDate>
		<dc:creator>omiga</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://omiga.org/blog/?p=255</guid>
		<description><![CDATA[index(subject) 搜索与参数表示的对象匹配的元素，并返回相应元素的索引值。如果找到了匹配的元素，从0开始返回；如果没有找到匹配的元素，返回-1。 data() data(elem)：为页面对象添加唯一标识。 data(name, value)：将数据保存在元素的一个key里面。$(&#34;#box&#34;).data(&#34;shape&#34;,&#34;rectangle&#34;)。 data(name)：获取值。$(&#34;#box&#34;).data(&#34;shape&#34;) //&#34;rectangle&#34;。 removeData(name)：删除通过data()方法赋予的值。$(&#34;#box&#34;).removeData(&#34;shape&#34;)。 attr(key,fn) 为所有匹配的元素设置一个计算的属性值。不提供值，而是提供一个函数，由这个函数计算的值作为属性值。 hasClass(class) 检查当前的元素是否含有某个特定的类，如果有，则返回true。这其实就是is(&#34;.&#34; + class)。 val(val) 设置每一个匹配元素的值。在 jQuery 1.2, 这也可以为select元件赋值。参数val(String)要设置的值。 check,select,radio等都能使用为之赋值。参数val(Array&#60;String&#62;)用于 check/select 的值。 slice(start,[end]) 选取一个匹配的子集。 add(expr) 把与表达式匹配的元素添加到jQuery对象中。这个函数可以用于连接分别与两个表达式匹配的元素结果集。 参数expr(String, DOMElement, Array&#60;DOMElement&#62;)用于匹配元素并添加的表达式字符串，或者用于动态生成的HTML代码，如果是一个字符串数组则返回多个元素。 nextAll([expr]) 查找当前元素之后的所有元素。 prev([expr]) 取得一个包含匹配的元素集合中每一个元素紧邻的前一个同辈元素的元素集合。 prevAll([expr]) 查找当前元素之前所有的同辈元素。 andSelf() 将先前所选的加入当前元素中。 replaceWith(content) 将所有匹配的元素替换成指定的HTML或DOM元素。参数content(String, Element, jQuery):用于将匹配元素替换掉的内容。 replaceAll(selector) 用匹配的元素替换掉所有 selector匹配到的元素。参数selector(选择器)用于查找所要被替换的元素。 clone([true]) 克隆匹配的DOM元素并且选中这些克隆的副本。设置参数[true]是对象的所有事件处理一并克隆。 offset() 获取匹配元素在当前视口的相对偏移。返回的对象包含两个整形属性：top 和 left。此方法只对可见元素有效。 返回Object{top,left}。 one(type,[data],fn) 为每一个匹配元素的特定事件（像click）绑定一个一次性的事件处理函数。 在每个对象上，这个事件处理函数只会被执行一次。其他规则与bind()函数相同。这个事件处理函数会接收到一个事件对象，可以通过它来阻止（浏览器）默认的行为。如果既想取消默认的行为，又想阻止事件起泡，这个事件处理函数必须返回false。 [...]]]></description>
			<content:encoded><![CDATA[<h4>index(subject) </h4>
<p>搜索与参数表示的对象匹配的元素，并返回相应元素的索引值。如果找到了匹配的元素，从0开始返回；如果没有找到匹配的元素，返回-1。 </p>
<h4>data()</h4>
<p>data(elem)：为页面对象添加唯一标识。</p>
<p>data(name, value)：将数据保存在元素的一个key里面。$(&quot;#box&quot;).data(&quot;shape&quot;,&quot;rectangle&quot;)。</p>
<p>data(name)：获取值。$(&quot;#box&quot;).data(&quot;shape&quot;) //&quot;rectangle&quot;。</p>
<p>removeData(name)：删除通过data()方法赋予的值。$(&quot;#box&quot;).removeData(&quot;shape&quot;)。</p>
<h4>attr(key,fn)</h4>
<p>为所有匹配的元素设置一个计算的属性值。不提供值，而是提供一个函数，由这个函数计算的值作为属性值。 </p>
<h4>hasClass(class) </h4>
<p>检查当前的元素是否含有某个特定的类，如果有，则返回true。这其实就是is(&quot;.&quot; + class)。</p>
<h4>val(val) </h4>
<p>设置每一个匹配元素的值。在 jQuery 1.2, 这也可以为select元件赋值。参数val(String)要设置的值。</p>
<p>check,select,radio等都能使用为之赋值。参数val(Array&lt;String&gt;)用于 check/select 的值。</p>
<h4>slice(start,[end]) </h4>
<p>选取一个匹配的子集。</p>
<h4>add(expr) </h4>
<p>把与表达式匹配的元素添加到jQuery对象中。这个函数可以用于连接分别与两个表达式匹配的元素结果集。</p>
<p>参数expr(String, DOMElement, Array&lt;DOMElement&gt;)用于匹配元素并添加的表达式字符串，或者用于动态生成的HTML代码，如果是一个字符串数组则返回多个元素。</p>
<h4>nextAll([expr]) </h4>
<p>查找当前元素之后的所有元素。 </p>
<h4>prev([expr]) </h4>
<p>取得一个包含匹配的元素集合中每一个元素紧邻的前一个同辈元素的元素集合。 </p>
<h4>prevAll([expr]) </h4>
<p>查找当前元素之前所有的同辈元素。</p>
<h4>andSelf() </h4>
<p>将先前所选的加入当前元素中。</p>
<h4>replaceWith(content) </h4>
<p>将所有匹配的元素替换成指定的HTML或DOM元素。参数content(String, Element, jQuery):用于将匹配元素替换掉的内容。</p>
<h4>replaceAll(selector) </h4>
<p>用匹配的元素替换掉所有 selector匹配到的元素。参数selector(选择器)用于查找所要被替换的元素。</p>
<h4>clone([true]) </h4>
<p>克隆匹配的DOM元素并且选中这些克隆的副本。设置参数[true]是对象的所有事件处理一并克隆。</p>
<h4>offset() </h4>
<p>获取匹配元素在当前视口的相对偏移。返回的对象包含两个整形属性：top 和 left。此方法只对可见元素有效。</p>
<p>返回Object{top,left}。</p>
<h4>one(type,[data],fn) </h4>
<p>为每一个匹配元素的特定事件（像click）绑定一个<em>一次性</em>的事件处理函数。</p>
<p>在每个对象上，这个事件处理函数只会被执行一次。其他规则与bind()函数相同。这个事件处理函数会接收到一个事件对象，可以通过它来阻止（浏览器）默认的行为。如果既想取消默认的行为，又想阻止事件起泡，这个事件处理函数必须返回false。</p>
<h4>toggle(fn,fn2,[fn3,fn4,...]) </h4>
<p>每次点击时切换要调用的函数。函数数目可以是多个。</p>
<h4>stop() </h4>
<p>停止所有在指定元素上正在运行的动画。如果队列中有等待执行的动画，他们将被马上执行。</p>
<h4>queue([callback/queue])</h4>
<p>queue：返回指向第一个匹配元素的队列(将是一个函数数组。</p>
<p>queue(callback)：在匹配的元素的动画队列中添加一个函数。</p>
<p>queue(queue)：将匹配元素的动画队列用新的一个队列来代替(函数数组)。 </p>
<h4>dequeue() </h4>
<p>从动画队列中移除一个队列函数。</p>
<h4>jQuery.browser.version </h4>
<p>浏览器渲染引擎版本号。</p>
<h4>jQuery.boxModel</h4>
<p>当前页面中浏览器是否使用标准盒模型渲染页面。</p>
<p>PS:以前很少用这些方法属性，很多还不知道。这跟中文CHM版jQuery API不无关系，那本广为流传的中文版手册已经过时，建议直接阅读<a href="http://docs.jquery.com/Main_Page" target="_blank">官方文档</a>。</p>
<hr />
<p><small>© omiga for <a href="http://omiga.org/blog">omiga</a>, 2008. |
<a href="http://omiga.org/blog/archives/255">Permalink</a> |
<a href="http://omiga.org/blog/archives/255#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://omiga.org/blog/archives/255&title=jQuery中一些不常用的方法属性">del.icio.us</a>
<br/>
Post tags: <a href="http://omiga.org/blog/archives/tag/javascript" rel="tag">javascript</a>, <a href="http://omiga.org/blog/archives/tag/jquery" rel="tag">jQuery</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://omiga.org/blog/archives/255/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>封装一个图片轮换效果</title>
		<link>http://omiga.org/blog/archives/108</link>
		<comments>http://omiga.org/blog/archives/108#comments</comments>
		<pubDate>Wed, 26 Mar 2008 07:19:35 +0000</pubDate>
		<dc:creator>omiga</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[ad_player]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://omiga.org/2008/03/26/%e5%b0%81%e8%a3%85%e4%b8%80%e4%b8%aa%e5%9b%be%e7%89%87%e8%bd%ae%e6%8d%a2%e6%95%88%e6%9e%9c/</guid>
		<description><![CDATA[这个东西，每次都要写，索性把它封装起来，其实并没有完全地封装，倒是可以重复使用了～···基于jQuery，需jQuery1.1.2+版本支持～···以前用纯JS写过一个，在这里，这个其实也可以用以前我写过的一些函数来实现，但是有jQuery就偷下懒了～···呵呵～ 添加删除内容只需更新scripts文件夹下ap.js文件中的adList 对象即可～··· 使用之前需创建一个id为img_ad的对象，以作为容器，并为其定义宽高，可随意修改ap.css，以达到你需要的效果～··· 内置两种基本效果，可通过注释相应代码进行选择 ~ 效果演示 打包下载 © omiga for omiga, 2008. &#124; Permalink &#124; 8 comments &#124; Add to del.icio.us Post tags: ad_player, javascript, jQuery]]></description>
			<content:encoded><![CDATA[<p><img src="http://omiga.org/img/ad_player.jpg" /></p>
<p>这个东西，每次都要写，索性把它封装起来，其实并没有完全地封装，倒是可以重复使用了～···基于<a href="http://omiga.org/2008/03/15/%e4%bd%bf%e7%94%a8jquery%e8%bf%9b%e8%a1%8c%e4%be%bf%e6%8d%b7web%e5%bc%80%e5%8f%91/" target="_blank">jQuery</a>，需jQuery1.1.2+版本支持～···以前用纯JS写过一个，在<a href="http://omiga.org/2007/11/28/%e9%98%bf%e9%87%8c%e5%a6%88%e5%a6%88%e9%a6%96%e9%a1%b5%e5%9b%be%e7%89%87%e5%b9%bf%e5%91%8a/" target="_blank">这里</a>，这个其实也可以用以前我写过的<a href="http://omiga.org/2008/01/25/%e4%b8%80%e4%ba%9b%e6%9c%89%e7%94%a8%e7%9a%84js%e5%87%bd%e6%95%b0%ef%bc%88%e4%b8%80%ef%bc%89/" target="_blank">一些函数</a>来实现，但是有jQuery就偷下懒了～···呵呵～</p>
<p>添加删除内容只需更新scripts文件夹下ap.js文件中的adList 对象即可～···</p>
<p>使用之前需创建一个id为img_ad的对象，以作为容器，并为其定义宽高，可随意修改ap.css，以达到你需要的效果～···</p>
<p>内置两种基本效果，可通过注释相应代码进行选择 ~</p>
<p><a href="http://omiga.org/lab/ad_player/" target="_blank">效果演示 </a></p>
<p><a href="http://omiga.org/download/ad_player.rar">打包下载 </a></p>
<hr />
<p><small>© omiga for <a href="http://omiga.org/blog">omiga</a>, 2008. |
<a href="http://omiga.org/blog/archives/108">Permalink</a> |
<a href="http://omiga.org/blog/archives/108#comments">8 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://omiga.org/blog/archives/108&title=封装一个图片轮换效果">del.icio.us</a>
<br/>
Post tags: <a href="http://omiga.org/blog/archives/tag/ad_player" rel="tag">ad_player</a>, <a href="http://omiga.org/blog/archives/tag/javascript" rel="tag">javascript</a>, <a href="http://omiga.org/blog/archives/tag/jquery" rel="tag">jQuery</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://omiga.org/blog/archives/108/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>jQuery1.2选择器</title>
		<link>http://omiga.org/blog/archives/99</link>
		<comments>http://omiga.org/blog/archives/99#comments</comments>
		<pubDate>Sun, 16 Mar 2008 03:57:56 +0000</pubDate>
		<dc:creator>omiga</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://omiga.org/2008/03/16/jquery12%e9%80%89%e6%8b%a9%e5%99%a8/</guid>
		<description><![CDATA[接前文——使用jQuery进行便捷web开发 严格来说这些东西都没有多少原创性可言，只是总结一些东西，方便自己，也顺便方便一下别人～ jQuery的选择器是极其强大并且有趣的，他结合了CSS1，CSS2，部分CSS3以及部分XPath的语法，同时并有一些专有的扩展 ，这样，使用起来便得心应手。 最基本的选择器 #id 通过id获取对象你就可以这样写了$(“#id”)，而不用再getElementById(“id”)，当然实际上，很多人都在自己定义$的getElementById方法； #.class 通过class获取对象，javascript中是没有专门的类似函数的 element 类似于getElementsByTagName * 用于匹配所有元素 组合选择器 直接将CSS中组合选择器的思想引用过来，各选择器之间以逗号区分，如：$(“#id,.class,h1&#8243;) 层级选择器 $(“parent children”) 匹配给定祖先元素下的所有后代元素，如：$(“form input”)将匹配所有表单元素中的input元素 parent &#62; child 匹配给定祖先元素下的子元素，而非所有后代元素 prev + next 匹配一个有效选择器pre后紧接着的第一个选择器 prev ～ siblings 匹配一个有效选择器pre后的所有同级选择器 基本滤镜 :first 匹配返回对象中的第一个元素，如：$(“div:first”)将返回DOM树中的第一个div :last 匹配返回对象中的最后一个元素 :not 去除所有与给定选择器匹配的元素，如：$(“div:not(&#8216;.post&#8217;)”)将返回class部位“post”的所有div元素 :even 匹配所有索引值为偶数的元素，从 0 开始计数，这个选择器在制作“斑马线”是十分有效，如：$(“td:even”).css(“backgroundColor”,”#FFF”) :odd 匹配所有索引值为奇数的元素 :eq(index) 匹配一个给定索引值的元素，如：$(“p:eq(0)”)将返回文档中的第一个文本段落 :gt(index) 匹配所有大于给定索引值的元素 :lt(index) 匹配所有小于给定索引值的元素 :header 匹配如 h1, h2, [...]]]></description>
			<content:encoded><![CDATA[<p>接前文——<a href="http://omiga.org/blog/2008/03/15/%e4%bd%bf%e7%94%a8jquery%e8%bf%9b%e8%a1%8c%e4%be%bf%e6%8d%b7web%e5%bc%80%e5%8f%91/" target="_blank">使用jQuery进行便捷web开发</a></p>
<p>严格来说这些东西都没有多少原创性可言，只是总结一些东西，方便自己，也顺便方便一下别人～</p>
<p>jQuery的选择器是极其强大并且有趣的，他结合了CSS1，CSS2，部分CSS3以及部分XPath的语法，同时并有一些专有的扩展 ，这样，使用起来便得心应手。</p>
<p>最基本的选择器</p>
<blockquote>
<ul>
<li>#id    通过id获取对象你就可以这样写了$(“#id”)，而不用再getElementById(“id”)，当然实际上，很多人都在自己定义$的getElementById方法；</li>
<li>#.class    通过class获取对象，javascript中是没有专门的类似函数的</li>
<li>element      类似于getElementsByTagName</li>
<li>*   用于匹配所有元素</li>
<li>组合选择器     直接将CSS中组合选择器的思想引用过来，各选择器之间以逗号区分，如：$(“#id,.class,h1&#8243;)</li>
</ul>
</blockquote>
<p>层级选择器</p>
<blockquote>
<ul>
<li> $(“parent children”)    匹配给定祖先元素下的所有后代元素，如：$(“form input”)将匹配所有表单元素中的input元素</li>
<li>parent &gt; child    匹配给定祖先元素下的子元素，而非所有后代元素</li>
<li>prev + next    匹配一个有效选择器pre后紧接着的第一个选择器</li>
<li>prev ～ siblings    匹配一个有效选择器pre后的所有同级选择器</li>
</ul>
</blockquote>
<p>基本滤镜</p>
<blockquote>
<ul>
<li>:first    匹配返回对象中的第一个元素，如：$(“div:first”)将返回DOM树中的第一个div</li>
<li>:last    匹配返回对象中的最后一个元素</li>
<li>:not    去除所有与给定选择器匹配的元素，如：$(“div:not(&#8216;.post&#8217;)”)将返回class部位“post”的所有div元素</li>
<li>:even    匹配所有索引值为偶数的元素，从 0 开始计数，这个选择器在制作“斑马线”是十分有效，如：$(“td:even”).css(“backgroundColor”,”#FFF”)</li>
<li>:odd    匹配所有索引值为奇数的元素</li>
<li>:eq(index)    匹配一个给定索引值的元素，如：$(“p:eq(0)”)将返回文档中的第一个文本段落</li>
<li>:gt(index)    匹配所有大于给定索引值的元素</li>
<li>:lt(index)    匹配所有小于给定索引值的元素</li>
<li>:header    匹配如 h1, h2, h3之类的标题元素</li>
<li>:animated    匹配所有正在执行动画效果的元素，如：$(“div:not(:animated)”)</li>
</ul>
</blockquote>
<p>子元素滤镜</p>
<blockquote>
<ul>
<li>:nth-child(index/even/odd/equation)    匹配其父元素下的第N个子或奇偶元素
<p class="longdesc">&#8216;:eq(index)&#8217; 只匹配一个元素，而这个将为每一个父元素匹配子元素。:nth-child从1开始的，而:eq()是从0算起的！可以使用<br />
:nth-child(even)<br />
:nth-child(odd)<br />
:nth-child(3n)<br />
:nth-child(2)<br />
:nth-child(3n+1)<br />
:nth-child(3n+2)<br />
如：$(“ul li:noth-child(2)”)将匹配所有ul下的第二个li元素</li>
<li>:first-child    匹配第一个子元素，如$(“ul li:first-child”)将匹配ul的第一个li元素</li>
<li>last-child    匹配最后一个子元素</li>
<li>only-child   当该元素为其父元素的唯一子元素时将被匹配</li>
</ul>
</blockquote>
<p>属性滤镜</p>
<blockquote>
<ul>
<li>[attribute]    匹配包含特定属性的元素，如：$(“img[title]“)将匹配所有拥有title属性呃img元素</li>
<li>[attribute=value]    匹配特定属性为特定值的元素，如：$(“img[title='点击查看原图']“)匹配所有title属性为“点击查看原图”的img元素</li>
<li>[attribute^=value]    匹配特定属性其值以特定字符为起始值的元素，如：$(“img[title^='点击']“)匹配所有title属性以“点击”开始的img元素</li>
<li>[attribute$=value]    匹配特定属性其值以特定字符结尾的元素</li>
<li>[attribute*=value]    匹配特定属性其值包含特定字符的元素</li>
<li>复合属性选择器    如：$(“img[title^='点击'][title$='原图']“)</li>
</ul>
</blockquote>
<p>表单滤镜</p>
<blockquote>
<ul>
<li>:input    匹配所有 input, textarea, select 和 button 元素，如：$(:input)</li>
<li>:text    匹配所有的单行文本框</li>
<li><span class="feiyu_say">:password </span>匹配密码域</li>
<li><span class="feiyu_say">:radio </span>匹配单选按钮</li>
<li><span class="feiyu_say">:checkbox </span>匹配复选框</li>
<li><span class="feiyu_say">:sumbit </span>匹配提交按钮</li>
<li><span class="feiyu_say">:image </span>匹配图像域</li>
<li><span class="feiyu_say">:reset </span>匹配重置按钮</li>
<li><span class="feiyu_say">:buttom </span>匹配按钮</li>
<li><span class="feiyu_say">:file </span>匹配文件域</li>
<li><span class="feiyu_say">:enabled </span>匹配所有可用的元素</li>
<li><span class="feiyu_say">:disabled </span>匹配所有禁用的元素</li>
<li><span class="feiyu_say">:checked </span>匹配所有被选中的表单</li>
<li><span class="feiyu_say">:selected </span>匹配所有选择的表单</li>
<li><span class="feiyu_say">:hidden </span>匹配所有不可见元素，或者type为hidden的元素</li>
</ul>
</blockquote>
<p>其他滤镜</p>
<blockquote>
<ul>
<li> :contains(text)    匹配包含给定文本的元素，如：$(“p:contains(&#8216;jQuery&#8217;)”)将匹配包含”jQuery”的所有段落元素</li>
<li>:empty    匹配所有不包含子元素或者文本的空元素</li>
<li>:has    匹配所有不包含子元素或者文本的空元素，如：$(“div:has(&#8216;p&#8217;)”)将匹配所有包含有段落元素的div元素</li>
<li>:parent    匹配含有子元素或者文本的元素</li>
<li>:visible    匹配所有的可见元素</li>
</ul>
</blockquote>
<p>本文相关链接：</p>
<ul>
<li><a href="http://omiga.org/jqueryapi12" target="_blank">jQuery1.2 API</a></li>
<li>jQuery for JavaScript programmers <a href="http://simonwillison.net/2007/Aug/15/jquery/" target="_blank">原文</a> <a href="http://www.yeeyan.com/articles/view/davidkoree/4568" target="_blank">译文</a></li>
</ul>
<hr />
<p><small>© omiga for <a href="http://omiga.org/blog">omiga</a>, 2008. |
<a href="http://omiga.org/blog/archives/99">Permalink</a> |
<a href="http://omiga.org/blog/archives/99#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://omiga.org/blog/archives/99&title=jQuery1.2选择器">del.icio.us</a>
<br/>
Post tags: <a href="http://omiga.org/blog/archives/tag/javascript" rel="tag">javascript</a>, <a href="http://omiga.org/blog/archives/tag/jquery" rel="tag">jQuery</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://omiga.org/blog/archives/99/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>使用jQuery进行便捷web开发</title>
		<link>http://omiga.org/blog/archives/96</link>
		<comments>http://omiga.org/blog/archives/96#comments</comments>
		<pubDate>Sat, 15 Mar 2008 15:18:55 +0000</pubDate>
		<dc:creator>omiga</dc:creator>
				<category><![CDATA[前端开发]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://omiga.org/2008/03/15/%e4%bd%bf%e7%94%a8jquery%e8%bf%9b%e8%a1%8c%e4%be%bf%e6%8d%b7web%e5%bc%80%e5%8f%91/</guid>
		<description><![CDATA[咳咳～这个题目～不废话吗～谁写JS框架是为了进行“笨重”开发？嗯～这个～囧～OK，不废话了&#8230;接触jQuery有一段时间了，关于jQuery本身我就不再多做介绍，大家可以随意google或者baidu，也可访问jQuery的官方网站~&#8230;个人认为只要稍有编程基础，jQuery的学习还是比较轻松的。当然如果你掌握一点DOM，CSS的知识就更好了～这不是一篇教程，而是一点个人学习的总结，所以谈及比较重要的一些知识点。 使用jQuery进行开发时需要改变一些惯有的编程习惯，或者说是编程风格。其中最重要的一点便是DOM对象和jQuery对象之间的类型转换。因为单纯的jQuery对象是无法使用DOM定义的方法和属性的，jQuery对象和DOM对象之间的方法是不能混用的。比如有$(“.myClass”)这样一个jQuery对象，可以通过以下方法来进行类型的转换： $(“.myClass”)[0]，直接获取该jQuery对象中的第一个元素。当然如果你是$(“#myId”)[0]那么实际上返回的就是id值为“myId”的DOM对象。 $(“.myClass”).get(0)，其等价于$(“.myClass”)[0]，没什么区别 $(document).ready(function(){})，$(function(){})和jQuery(function(){})这三种写法有什么区别吗？我现在也没弄清楚。在传统的javascript中，window.onload似乎是用来装载JS的唯一方法，但是这个方法却有明显的弊端。因为onload事件本身就是在整个页面内容下载完成后才触发，包括图片。但实际上在很多时候这是不需要的，JS很多时候用来操纵DOM，那么只需要DOM树下载完成就可以了，那么这个时候你就可以用$(document).ready()来，DOM树装载完成即可触发。 jQuery支持方法的连写，什么意思？在传统JS中一个链接的简单hover效果你需要分别为onmouseover和onmouseout事件定义事件函数。但是在jQuery中可以这样写 $(“#myLink”).mouseover(function(){}).mouseout(function()) 怎么样？很简单吧～当然你如果愿意你可以继续在后面添加事件函数，比如： $(“#myLink”).mouseover(function(){}).mouseout(function()).click(function(){}).addClass(“myClass”) 同一函数实现set和get。比如html()： alert($(“#myId”).html()) //get $(“#myId”).html( 文本段落 ) //set 这类函数即可以用来获取值，同时也能设置值。这样的函数还有：text()，height()，weidth()，val()，其实css()，click()也可以算是这类函数～···，这样一来其实整个jQuery里面的函数很多都是既可以set也可以get的～ jQuery中的事件触发皆省略掉传统javascript中的on，本文前面已有例子。比如传统方法你得这样写： myElement.onclick=function(){} 而在jQuery中你可以简单地写成这样： myElement.click(function(){}) 除此之外jQuery中还有一些自定义的事件：hover()，ready()，toggle()，triggle()，bind()，unbind()，这些事件函数具体定义请参考jQuery的API，在此不作赘述。 浏览器的判断$.browser，可用值：safari，opera，msie，mozilla。该属性在DOM装载完成之前就是有效的，故可以通过此属性先判断浏览器类型，再为特定浏览器编写程序。 if($.browser.msie){alert(“this is ie”)} 利用noConflict()实现多库共存。我们知道这个地球上不止jQuery这样一个JS框架，还有大名鼎鼎的prototype，YUI，Dojo等～有时难免会同时使用多个框架，难免发生命名冲突。就比如“$”在prototype和jQuery中都有定义，如不做处理必然导致命名冲突。那么这时候我们就可以使用noConflict()函数将变量$的控制权让渡出来。 jQuery.noConflict(); //转让控制权 jQuery(“div p”).hide(); // 使用 jQuery $(“content”).style.display = &#8216;none&#8217;; //使用其他库的 $() &#8230;&#8230;. 除此之外，jQuery强大的选择器，是学习jQuery必须牢固掌握的，关于jQuery选择器，将单独撰文介绍～ 严格来说jQuery只是一个封装了一些函数的JS类库，如果你熟悉javascript，那么掌握jQuery应该来说是没有任何难度的，所以jQuery很多精髓的东西可能还是其一些功能强大 的函数，函数的具体使用介绍可参考jQuery的API。同时互联网上也有很多jQuery的学习资料，稍花时间便可掌握。 附：一些jQuery学习资源 jQuery官方网站 jQuery中文社区 15 Days Of jQuery 中文版 英文版 jQuery起点教程 jQuery for [...]]]></description>
			<content:encoded><![CDATA[<p>咳咳～这个题目～不废话吗～谁写JS框架是为了进行“笨重”开发？嗯～这个～囧～OK，不废话了&#8230;接触jQuery有一段时间了，关于jQuery本身我就不再多做介绍，大家可以随意google或者baidu，也可访问j<a href="http://jquery.com/" target="_blank">Query的官方网站</a>~&#8230;个人认为只要稍有编程基础，jQuery的学习还是比较轻松的。当然如果你掌握一点DOM，CSS的知识就更好了～这不是一篇教程，而是一点个人学习的总结，所以谈及比较重要的一些知识点。</p>
<p>使用jQuery进行开发时需要改变一些惯有的编程习惯，或者说是编程风格。其中最重要的一点便是DOM对象和jQuery对象之间的类型转换。因为单纯的jQuery对象是无法使用DOM定义的方法和属性的，jQuery对象和DOM对象之间的方法是不能混用的。比如有$(“.myClass”)这样一个jQuery对象，可以通过以下方法来进行类型的转换：</p>
<ol>
<li> $(“.myClass”)[0]，直接获取该jQuery对象中的第一个元素。当然如果你是$(“#myId”)[0]那么实际上返回的就是id值为“myId”的DOM对象。</li>
<li>$(“.myClass”).get(0)，其等价于$(“.myClass”)[0]，没什么区别</li>
</ol>
<p>$(document).ready(function(){})，$(function(){})和jQuery(function(){})这三种写法有什么区别吗？我现在也没弄清楚。在传统的javascript中，window.onload似乎是用来装载JS的唯一方法，但是这个方法却有明显的弊端。因为onload事件本身就是在整个页面内容下载完成后才触发，包括图片。但实际上在很多时候这是不需要的，JS很多时候用来操纵DOM，那么只需要DOM树下载完成就可以了，那么这个时候你就可以用$(document).ready()来，DOM树装载完成即可触发。</p>
<p>jQuery支持方法的连写，什么意思？在传统JS中一个链接的简单hover效果你需要分别为onmouseover和onmouseout事件定义事件函数。但是在jQuery中可以这样写<br />
<coolcode><br />
$(“#myLink”).mouseover(function(){}).mouseout(function())</coolcode><br />
怎么样？很简单吧～当然你如果愿意你可以继续在后面添加事件函数，比如：<br />
<coolcode><br />
$(“#myLink”).mouseover(function(){}).mouseout(function()).click(function(){}).addClass(“myClass”)<br />
</coolcode><br />
同一函数实现set和get。比如html()：<br />
<coolcode><br />
alert($(“#myId”).html())    //get<br />
$(“#myId”).html(
<p>文本段落</p>
<p>)    //set<br />
</coolcode><br />
这类函数即可以用来获取值，同时也能设置值。这样的函数还有：text()，height()，weidth()，val()，其实css()，click()也可以算是这类函数～···，这样一来其实整个jQuery里面的函数很多都是既可以set也可以get的～</p>
<p>jQuery中的事件触发皆省略掉传统javascript中的on，本文前面已有例子。比如传统方法你得这样写：<br />
<coolcode><br />
myElement.onclick=function(){}<br />
</coolcode><br />
而在jQuery中你可以简单地写成这样：<br />
<coolcode><br />
myElement.click(function(){})<br />
</coolcode><br />
除此之外jQuery中还有一些自定义的事件：hover()，ready()，toggle()，triggle()，bind()，unbind()，这些事件函数具体定义请参考jQuery的API，在此不作赘述。</p>
<p>浏览器的判断$.browser，可用值：safari，opera，msie，mozilla。该属性在DOM装载完成之前就是有效的，故可以通过此属性先判断浏览器类型，再为特定浏览器编写程序。<br />
<coolcode><br />
if($.browser.msie){alert(“this is ie”)}</coolcode><br />
利用noConflict()实现多库共存。我们知道这个地球上不止jQuery这样一个JS框架，还有大名鼎鼎的prototype，YUI，Dojo等～有时难免会同时使用多个框架，难免发生命名冲突。就比如“$”在prototype和jQuery中都有定义，如不做处理必然导致命名冲突。那么这时候我们就可以使用noConflict()函数将变量$的控制权让渡出来。<br />
<coolcode><br />
jQuery.noConflict();    //转让控制权<br />
jQuery(“div p”).hide();    // 使用 jQuery<br />
$(“content”).style.display = &#8216;none&#8217;;    //使用其他库的 $()</coolcode><br />
&#8230;&#8230;.</p>
<p>除此之外，jQuery强大的选择器，是学习jQuery必须牢固掌握的，关于<a href="http://omiga.org/blog/2008/03/16/jquery12%e9%80%89%e6%8b%a9%e5%99%a8/" target="_blank">jQuery选择器</a>，将单独撰文介绍～</p>
<p>严格来说jQuery只是一个封装了一些函数的JS类库，如果你熟悉javascript，那么掌握jQuery应该来说是没有任何难度的，所以jQuery很多精髓的东西可能还是其一些功能强大 的函数，函数的具体使用介绍可参考jQuery的API。同时互联网上也有很多jQuery的学习资料，稍花时间便可掌握。</p>
<p>附：一些jQuery学习资源</p>
<ul>
<li><a href="http://jquery.com/" target="_blank">jQuery官方网站</a></li>
<li><a href="http://jquery.org.cn">jQuery中文社区</a></li>
<li>15 Days Of jQuery <a href="http://jquery.org.cn" target="_blank">中文版</a> <a href="http://15daysofjquery.com/" target="_blank">英文版</a></li>
<li><a href="http://www.k99k.com/jQuery_getting_started.html" target="_blank">jQuery起点教程</a></li>
<li><a href="http://simonwillison.net/2007/Aug/15/jquery/" target="_blank">jQuery for Javascript programers</a></li>
<li><a href="http://omiga.org/jqueryapi12" target="_blank">jQuery 1.2 API</a></li>
</ul>
<hr />
<p><small>© omiga for <a href="http://omiga.org/blog">omiga</a>, 2008. |
<a href="http://omiga.org/blog/archives/96">Permalink</a> |
<a href="http://omiga.org/blog/archives/96#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://omiga.org/blog/archives/96&title=使用jQuery进行便捷web开发">del.icio.us</a>
<br/>
Post tags: <a href="http://omiga.org/blog/archives/tag/dom" rel="tag">DOM</a>, <a href="http://omiga.org/blog/archives/tag/javascript" rel="tag">javascript</a>, <a href="http://omiga.org/blog/archives/tag/jquery" rel="tag">jQuery</a><br/>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://omiga.org/blog/archives/96/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

