<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.wangtao.name/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.wangtao.name" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/wangtaoname" type="application/rss+xml"></fs:self_link><lastBuildDate>Thu, 10 Nov 2011 09:57:33 GMT</lastBuildDate><title>王涛的博客</title><description>wangtao.name</description><link>http://wangtao.name</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Thu, 10 Nov 2011 09:57:33 GMT</pubDate><item><title>用于测试twitter。</title><link>http://wangtao.name/blog/2011/11/10/test-twitter/</link><content:encoded>&lt;p&gt;这是一个测试文章，看twitter会不会自动同步博客文章。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386305/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/11/10/test-twitter/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/11/10/test-twitter/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>这是一个测试文章，看twitter会不会自动同步博客文章。&lt;img src=&quot;http://www1.feedsky.com/t1/575386305/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/11/10/test-twitter/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Thu, 10 Nov 2011 17:57:33 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/11/10/test-twitter/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=551</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/11/10/test-twitter/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386305/6104254</fs:itemid></item><item><title>【记录】flash遮盖div的问题。</title><link>http://wangtao.name/blog/2011/10/21/flash-cover-div/</link><content:encoded>&lt;p&gt;flash始终飘在div层上，设置z-index属性无效。解决的方法是加上wmode属性。&lt;/p&gt;
&lt;p&gt;关于wmode属性可查看&lt;a href=&quot;http://kb2.adobe.com/cps/127/tn_12701.html#main_Using_Window_Mode__wmode__values_&quot;&gt;这里&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;代码(定义嵌入内容，插件)：&lt;/p&gt;
&lt;p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html4strict&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;embed &lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;100%&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;100%&amp;quot;&lt;/span&gt; allownetworking&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;all&amp;quot;&lt;/span&gt; allowscriptaccess&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;always&amp;quot;&lt;/span&gt; quality&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;high&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;bgcolor&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;#666&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Jvideo&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;JvideoFlash&amp;quot;&lt;/span&gt; wmode&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;transparent&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;wmode.swf&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;application/x-shockwave-flash&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;或（以ActiveX控件运行flash的浏览器，比如IE系）：&lt;/p&gt;
&lt;p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html4strict&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;object&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;classid&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;codebase&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;width&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;300&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;height&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;300&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;param&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;movie&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;wmode.swf&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;param&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;quality&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;high&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;param&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;wmode&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;transparent&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;object&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;对flash做了这样的操作后，就可以使用z-index操作遮盖问题了。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386306/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/10/21/flash-cover-div/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/10/21/flash-cover-div/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>flash始终飘在div层上，设置z-index属性无效。解决的方法是加上wmode属性。 关于wmode属性可查看这里 代码(定义嵌入内容，插件)： &amp;#60;embed width=&amp;#34;100%&amp;#34; height=&amp;#34;100%&amp;#34; allownetworking=&amp;#34;all&amp;#34; allowscriptaccess=&amp;#34;always&amp;#34; quality=&amp;#34;high&amp;#34; bgcolor=&amp;#34;#666&amp;#34; name=&amp;#34;Jvideo&amp;#34; id=&amp;#34;JvideoFlash&amp;#34; wmode=&amp;#34;transparent&amp;#34; src=&amp;#34;wmode.swf&amp;#34; type=&amp;#34;application/x-shockwave-flash&amp;#34;&amp;#62; 或（以ActiveX控件运行flash的浏览器，比如IE系）： &amp;#60;object classid=&amp;#34;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&amp;#34; codebase=&amp;#34;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&amp;#34; width=&amp;#34;300&amp;#34; height=&amp;#34;300&amp;#34;&amp;#62; &amp;#60;param name=&amp;#34;movie&amp;#34; value=&amp;#34;wmode.swf&amp;#34;&amp;#62; &amp;#60;param name=&amp;#34;quality&amp;#34; value=&amp;#34;high&amp;#34;&amp;#62; &amp;#60;param name=&amp;#34;wmode&amp;#34; value=&amp;#34;transparent&amp;#34;&amp;#62;&amp;#60;/object&amp;#62; 对flash做了这样的操作后，就可以使用z-index操作遮盖问题了。&lt;img src=&quot;http://www1.feedsky.com/t1/575386306/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/10/21/flash-cover-div/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Fri, 21 Oct 2011 16:36:48 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/10/21/flash-cover-div/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=544</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/10/21/flash-cover-div/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386306/6104254</fs:itemid></item><item><title>jquery获得当前节点的兄弟节点</title><link>http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/</link><content:encoded>&lt;p&gt;例如有这样的HTML结构&lt;/p&gt;
&lt;p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html4strict&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;标题1&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目1&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目2&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;标题2&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目1&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目2&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;需要点击h3，对其兄弟节点ul进行相关操作：&lt;/p&gt;
&lt;p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;javascript&quot; style=&quot;font-family:monospace;&quot;&gt;$&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;.title&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt; $&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;parent&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;find&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'ul'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;addClass&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'show'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;就是先返回其父节点，然后再在其子节点搜索ul，返回jQuery对象，可以使用jQuery的各种方法进行操作。这种方式会对所以符合要求的子节点进行操作，需要查某一个，可以选择搜索class。&lt;/p&gt;
&lt;p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html4strict&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;标题1&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;x2&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目1&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目2&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目4&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目5&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目6&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目7&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目8&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目9&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;标题1&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h3&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目11&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目12&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目12&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目14&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目15&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目16&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目17&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;项目18&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;li&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;ul&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;


&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;javascript&quot; style=&quot;font-family:monospace;&quot;&gt;$&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;&amp;quot;.title&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #003366; font-weight: bold;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt; $&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000066; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;parent&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;find&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'.x2'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #660066;&quot;&gt;addClass&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #3366CC;&quot;&gt;'show'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;半途不废学JavaScript，或许对你有用。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386307/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>例如有这样的HTML结构 &amp;#60;ul&amp;#62; &amp;#60;li&amp;#62; &amp;#60;h3 class=&amp;#34;title&amp;#34;&amp;#62;标题1&amp;#60;/h3&amp;#62; &amp;#60;ul&amp;#62; &amp;#60;li&amp;#62;项目1&amp;#60;/li&amp;#62; &amp;#60;li&amp;#62;项目2&amp;#60;/li&amp;#62; &amp;#60;/ul&amp;#62; &amp;#60;/li&amp;#62; &amp;#60;li&amp;#62; &amp;#60;h3 class=&amp;#34;title&amp;#34;&amp;#62;标题2&amp;#60;/h3&amp;#62; &amp;#60;ul&amp;#62; &amp;#60;li&amp;#62;项目1&amp;#60;/li&amp;#62; &amp;#60;li&amp;#62;项目2&amp;#60;/li&amp;#62; &amp;#60;/ul&amp;#62; &amp;#60;/li&amp;#62; &amp;#60;/ul&amp;#62; 需要点击h3，对其兄弟节点ul进行相关操作： $&amp;#40;&amp;#34;.title&amp;#34;&amp;#41;.click&amp;#40;function &amp;#40;&amp;#41; &amp;#123; $&amp;#40;this&amp;#41;.parent&amp;#40;&amp;#41;.find&amp;#40;'ul'&amp;#41;.addClass&amp;#40;'show'&amp;#41;; &amp;#125;&amp;#41;; 就是先返回其父节点，然后再在其子节点搜索ul，返回jQuery对象，可以使用jQuery的各种方法进行操作。这种方式会对所以符合要求的子节点进行操作，需要查某一个，可以选择搜索class。 &amp;#60;ul&amp;#62; &amp;#60;li&amp;#62; &amp;#60;h3 class=&amp;#34;title&amp;#34;&amp;#62;标题1&amp;#60;/h3&amp;#62; &amp;#60;ul class=&amp;#34;x2&amp;#34;&amp;#62; &amp;#60;li&amp;#62;项目1&amp;#60;/li&amp;#62; &amp;#60;li&amp;#62;项目2&amp;#60;/li&amp;#62; &amp;#60;/ul&amp;#62; &amp;#60;ul&amp;#62; &amp;#60;li&amp;#62;项目4&amp;#60;/li&amp;#62; &amp;#60;li&amp;#62;项目5&amp;#60;/li&amp;#62; &amp;#60;/ul&amp;#62; &amp;#60;ul&amp;#62; &amp;#8230; &lt;a href=&quot;http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/&quot;&gt;继续阅读 &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386307/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>jquery</category><category>JavaScript</category><pubDate>Tue, 21 Jun 2011 10:03:09 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=536</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/06/21/jquery-get-the-current-node-sibling/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386307/6104254</fs:itemid></item><item><title>常用布局</title><link>http://wangtao.name/blog/2011/03/02/common-layout/</link><content:encoded>&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;html4strict&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #00bbdd;&quot;&gt;&amp;lt;!DOCTYPE HTML&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;meta&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;http-equiv&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Content-Type&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;content&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;text/html; charset=utf-8&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;&lt;/span&gt;常用布局&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;title&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
			body {margin:0;padding:0;background:url(&amp;quot;bg2.png&amp;quot;) repeat-x;}
			p, h1 {margin:0;padding:0;text-align:center;}
			h1 {text-align:left;color:#FFFFFF;}
			#header {height:90px;background:url(&amp;quot;bg.png&amp;quot;) repeat-y center;margin:0 auto;display:table;width:100%;}
			#page {width:700px;height:500px;background:#2CDA4A;margin:0 auto;}
			#logo {width:700px;margin:0 auto;}
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;style&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;head&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;header&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;logo&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
				&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h1&lt;/span&gt;&amp;gt;&lt;/span&gt;头部内容&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;h1&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;div&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;div&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;page&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;这里是内容！&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;这里是内容！&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;这里是内容！&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;这里是内容！&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;这里是内容！&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;这里是内容！&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
			&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&amp;lt;-- &lt;span style=&quot;color: #cc66cc;&quot;&gt;11&lt;/span&gt; --&amp;gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;p&lt;/span&gt;&amp;gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;div&lt;/span&gt;&amp;gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;body&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #66cc66;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;http://wangtao.name/html/2011/03/b.html&quot;&gt;dome&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386308/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/03/02/common-layout/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/03/02/common-layout/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>&amp;#60;!DOCTYPE HTML&amp;#62; &amp;#60;html&amp;#62; &amp;#60;head&amp;#62; &amp;#60;meta http-equiv=&amp;#34;Content-Type&amp;#34; content=&amp;#34;text/html; charset=utf-8&amp;#34;&amp;#62; &amp;#60;title&amp;#62;常用布局&amp;#60;/title&amp;#62; &amp;#60;style type=&amp;#34;text/css&amp;#34;&amp;#62; body {margin:0;padding:0;background:url(&amp;#34;bg2.png&amp;#34;) repeat-x;} p, h1 {margin:0;padding:0;text-align:center;} h1 {text-align:left;color:#FFFFFF;} #header {height:90px;background:url(&amp;#34;bg.png&amp;#34;) repeat-y center;margin:0 auto;display:table;width:100%;} #page {width:700px;height:500px;background:#2CDA4A;margin:0 auto;} #logo {width:700px;margin:0 auto;} &amp;#60;/style&amp;#62; &amp;#60;/head&amp;#62; &amp;#60;body&amp;#62; &amp;#60;div id=&amp;#34;header&amp;#34;&amp;#62; &amp;#60;div id=&amp;#34;logo&amp;#34;&amp;#62; &amp;#60;h1&amp;#62;头部内容&amp;#60;/h1&amp;#62; &amp;#60;/div&amp;#62; &amp;#60;/div&amp;#62; &amp;#8230; &lt;a href=&quot;http://wangtao.name/blog/2011/03/02/common-layout/&quot;&gt;继续阅读 &lt;span class=&quot;meta-nav&quot;&gt;&amp;#8594;&lt;/span&gt;&lt;/a&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386308/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/03/02/common-layout/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>html</category><category>CSS</category><pubDate>Wed, 02 Mar 2011 07:41:59 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/03/02/common-layout/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=482</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/03/02/common-layout/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386308/6104254</fs:itemid></item><item><title>nginx X-Accel-Redirect下载文件的应用</title><link>http://wangtao.name/blog/2011/02/23/nginx-x-accel-redirect/</link><content:encoded>&lt;p&gt;要做一个下载的程序，如果直接是一个真实的文件链接，那么下载就无法进行控制。&lt;/p&gt;
&lt;p&gt;可以使用CGI程序将文件从服务器读出来，然后提交客户端下载。这个虽然可以在CGI程序里进行控制，但下载效率很低，对系统资源消耗高。最好的方法就是先用CGI程序控制文件的下载，然后将下载文件的任务交给web服务器。&lt;/p&gt;
&lt;p&gt;下面就是我利用nginx做的一次实验。&lt;/p&gt;
&lt;p&gt;X-Accel-Redirect：官方解释为&lt;a href=&quot;http://wiki.nginx.org/NginxXSendfile&quot;&gt;http://wiki.nginx.org/NginxXSendfile&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;我在nginx的配置文件里，添加下面的配置信息：&lt;/p&gt;
&lt;p&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;c&quot; style=&quot;font-family:monospace;&quot;&gt;location &lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;down &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
        internal&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
        alias   C&lt;span style=&quot;color: #339933;&quot;&gt;:/&lt;/span&gt;QMDownload&lt;span style=&quot;color: #339933;&quot;&gt;/&lt;/span&gt;test&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
        &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;我的php代码为：&lt;/p&gt;

&lt;div class=&quot;wp_syntax&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;pre class=&quot;php&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span style=&quot;color: #990000;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;Content-Type: application/force-download&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;         &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#表明是一个下载请求
&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'Accept-Range : byte '&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;   &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#文件单位
&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'Accept-Length: 3428'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;    &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#文件长度
&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;'Content-Disposition: attachment; filename=file.txt'&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#文件名
&lt;/span&gt;&lt;span style=&quot;color: #990000;&quot;&gt;header&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;&amp;quot;X-Accel-Redirect: /down/file.txt&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;      &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;#nginx重定向请求&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/p&gt;
&lt;p&gt;在这个配置信息中：&lt;/p&gt;
&lt;p&gt;第一行：表明监控/down的请求。&lt;/p&gt;
&lt;p&gt;第二行：表示这是一个服务器内部请求，不会泄漏给客户端。&lt;/p&gt;
&lt;p&gt;第三秆：别名，设置为文件存放的真实位置。&lt;/p&gt;
&lt;p&gt;在PHP程序中：前面四行就是告诉浏览器，这是一个下载请求，文件大小，文件名。最后一行，就是使用X-Accel-Redirect告诉浏览器文件在服务器的位置。file.txt这个文件在我电脑的位置为：“C:/QMDownload/test”，php网站目录为：C:/nginx-0.9.4/html。&lt;/p&gt;
&lt;p&gt;运行PHP时，X-Accel-Redirect会跳转文件到/down/file.txt，而在nginx里将down转换成内部路径C:/QMDownload/test，nginx就能直接读取到真实的文件路径“C:/QMDownload/test/file.txt”，并提交浏览器下载。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386309/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/02/23/nginx-x-accel-redirect/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/02/23/nginx-x-accel-redirect/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>要做一个下载的程序，如果直接是一个真实的文件链接，那么下载就无法进行控制。 可以使用CGI程序将文件从服务器读出来，然后提交客户端下载。这个虽然可以在CGI程序里进行控制，但下载效率很低，对系统资源消耗高。最好的方法就是先用CGI程序控制文件的下载，然后将下载文件的任务交给web服务器。 下面就是我利用nginx做的一次实验。 X-Accel-Redirect：官方解释为http://wiki.nginx.org/NginxXSendfile 我在nginx的配置文件里，添加下面的配置信息： location /down &amp;#123; internal; alias C:/QMDownload/test; &amp;#125; 我的php代码为： header&amp;#40;&amp;#34;Content-Type: application/force-download&amp;#34;&amp;#41;; #表明是一个下载请求 header&amp;#40;'Accept-Range : byte '&amp;#41;; #文件单位 header&amp;#40;'Accept-Length: 3428'&amp;#41;; #文件长度 header&amp;#40;'Content-Disposition: attachment; filename=file.txt'&amp;#41;;#文件名 header&amp;#40;&amp;#34;X-Accel-Redirect: /down/file.txt&amp;#34;&amp;#41;; #nginx重定向请求 在这个配置信息中： 第一行：表明监控/down的请求。 第二行：表示这是一个服务器内部请求，不会泄漏给客户端。 第三秆：别名，设置为文件存放的真实位置。 在PHP程序中：前面四行就是告诉浏览器，这是一个下载请求，文件大小，文件名。最后一行，就是使用X-Accel-Redirect告诉浏览器文件在服务器的位置。file.txt这个文件在我电脑的位置为：“C:/QMDownload/test”，php网站目录为：C:/nginx-0.9.4/html。 运行PHP时，X-Accel-Redirect会跳转文件到/down/file.txt，而在nginx里将down转换成内部路径C:/QMDownload/test，nginx就能直接读取到真实的文件路径“C:/QMDownload/test/file.txt”，并提交浏览器下载。&lt;img src=&quot;http://www1.feedsky.com/t1/575386309/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/02/23/nginx-x-accel-redirect/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>系统</category><pubDate>Wed, 23 Feb 2011 22:35:50 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/02/23/nginx-x-accel-redirect/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=468</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/02/23/nginx-x-accel-redirect/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386309/6104254</fs:itemid></item><item><title>今日情人节</title><link>http://wangtao.name/blog/2011/02/14/valentines-day/</link><content:encoded>&lt;p&gt;从公司步行回来，歌舞升平，好一派太平盛世模样。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386310/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/02/14/valentines-day/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/02/14/valentines-day/feed/</wfw:commentRss><slash:comments>2</slash:comments><description>从公司步行回来，歌舞升平，好一派太平盛世模样。&lt;img src=&quot;http://www1.feedsky.com/t1/575386310/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/02/14/valentines-day/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Mon, 14 Feb 2011 23:34:19 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/02/14/valentines-day/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=466</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/02/14/valentines-day/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386310/6104254</fs:itemid></item><item><title>萧伯纳的儿子</title><link>http://wangtao.name/blog/2011/02/11/george-bernard-shaw-son/</link><content:encoded>&lt;p&gt;大作家萧伯纳年轻的时候，便名声大噪了。美国著名舞蹈家邓肯有一次写信给他，说:“假如我们两个结婚，生下的孩子头脑像你，面孔像我，该有多好哟。”&lt;/p&gt;
&lt;p&gt;萧伯纳接到信，笑了笑，一本正经地给她回了一封信，其中一段是这样写的:“要是生的孩子，头脑像你，而面孔像我，那岂不是糟透了！”&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386311/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/02/11/george-bernard-shaw-son/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/02/11/george-bernard-shaw-son/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>大作家萧伯纳年轻的时候，便名声大噪了。美国著名舞蹈家邓肯有一次写信给他，说:“假如我们两个结婚，生下的孩子头脑像你，面孔像我，该有多好哟。” 萧伯纳接到信，笑了笑，一本正经地给她回了一封信，其中一段是这样写的:“要是生的孩子，头脑像你，而面孔像我，那岂不是糟透了！”&lt;img src=&quot;http://www1.feedsky.com/t1/575386311/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/02/11/george-bernard-shaw-son/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Fri, 11 Feb 2011 21:43:08 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/02/11/george-bernard-shaw-son/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=463</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/02/11/george-bernard-shaw-son/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386311/6104254</fs:itemid></item><item><title>明天回家了</title><link>http://wangtao.name/blog/2011/01/30/2011-go-home/</link><content:encoded>&lt;p&gt;这两周是非常忙碌一日子，连着上了十四天的班，每天七点多起床，凌晨1点多睡觉。每天在办公室除了写代码，还要思考这些代码用在哪里才是最优的。产品要有哪些功能。在临近过年的时间，白天写代码，晚上修复BUG。
&lt;/p&gt;
&lt;p&gt;每天一瓶咖啡，这两周写的代码就像作家写了部长篇小说一样。&lt;/p&gt;
&lt;p&gt;记得我小时候，想过当科学家，画家，发明家。现在我成为了一枚程序员，跟那些愿望都差不多。&lt;/p&gt;
&lt;p&gt;希望明年能入手一台mac book pro。&lt;/p&gt;
&lt;p&gt;希望明年能静下心来，多更新博客。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386312/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/01/30/2011-go-home/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/01/30/2011-go-home/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>这两周是非常忙碌一日子，连着上了十四天的班，每天七点多起床，凌晨1点多睡觉。每天在办公室除了写代码，还要思考这些代码用在哪里才是最优的。产品要有哪些功能。在临近过年的时间，白天写代码，晚上修复BUG。 每天一瓶咖啡，这两周写的代码就像作家写了部长篇小说一样。 记得我小时候，想过当科学家，画家，发明家。现在我成为了一枚程序员，跟那些愿望都差不多。 希望明年能入手一台mac book pro。 希望明年能静下心来，多更新博客。&lt;img src=&quot;http://www1.feedsky.com/t1/575386312/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/01/30/2011-go-home/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Sun, 30 Jan 2011 22:15:37 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/01/30/2011-go-home/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=459</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/01/30/2011-go-home/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386312/6104254</fs:itemid></item><item><title>忽然间想要写一个小软件</title><link>http://wangtao.name/blog/2011/01/29/write-a-small-software/</link><content:encoded>&lt;p&gt;windows的多窗口，很方便，方便用户在各个程序中快速切换。但是这样也容易出现注意力不集中，把时间大量浪费在从这个窗口换到那个窗口。&lt;/p&gt;
&lt;p&gt;所以我就想写一个这样的软件。目的在于提高电脑使用效率。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386313/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/01/29/write-a-small-software/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2011/01/29/write-a-small-software/feed/</wfw:commentRss><slash:comments>0</slash:comments><description>windows的多窗口，很方便，方便用户在各个程序中快速切换。但是这样也容易出现注意力不集中，把时间大量浪费在从这个窗口换到那个窗口。 所以我就想写一个这样的软件。目的在于提高电脑使用效率。&lt;img src=&quot;http://www1.feedsky.com/t1/575386313/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2011/01/29/write-a-small-software/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Sat, 29 Jan 2011 16:03:04 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2011/01/29/write-a-small-software/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=456</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2011/01/29/write-a-small-software/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386313/6104254</fs:itemid></item><item><title>年终总结。</title><link>http://wangtao.name/blog/2010/12/30/2010/</link><content:encoded>&lt;p&gt;今年6月从学校毕业了。7月1日加入到了现在的这个公司。忙并快乐着。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/575386314/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2010/12/30/2010/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://wangtao.name/blog/2010/12/30/2010/feed/</wfw:commentRss><slash:comments>2</slash:comments><description>今年6月从学校毕业了。7月1日加入到了现在的这个公司。忙并快乐着。&lt;img src=&quot;http://www1.feedsky.com/t1/575386314/wangtaoname/feedsky/s.gif?r=http://wangtao.name/blog/2010/12/30/2010/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>随便说说</category><pubDate>Thu, 30 Dec 2010 22:38:34 +0800</pubDate><author>王涛</author><comments>http://wangtao.name/blog/2010/12/30/2010/#comments</comments><guid isPermaLink="false">http://wangtao.name/?p=452</guid><dc:creator>王涛</dc:creator><fs:srclink>http://wangtao.name/blog/2010/12/30/2010/</fs:srclink><fs:srcfeed>http://wangtao.name/feed</fs:srcfeed><fs:itemid>feedsky/wangtaoname/~7995032/575386314/6104254</fs:itemid></item></channel></rss>
