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

<channel>
	<title>蓝色的华 &#187; 411</title>
	<atom:link href="http://bluehua.org/tag/411/feed" rel="self" type="application/rss+xml" />
	<link>http://bluehua.org</link>
	<description>分享所学,backup一切~</description>
	<lastBuildDate>Wed, 23 Nov 2011 08:43:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>411 Length Required</title>
		<link>http://bluehua.org/2009/07/23/343.html</link>
		<comments>http://bluehua.org/2009/07/23/343.html#comments</comments>
		<pubDate>Thu, 23 Jul 2009 04:11:38 +0000</pubDate>
		<dc:creator>冥王星2011</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[411]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=343</guid>
		<description><![CDATA[如果您恰好使用了ff浏览器(偶用ff3.0)，server端使用了nginx作代理，而某个ajax又恰好传了一个为null的数据，您就会看到这个错误 firefox下点run code运行下面代码,firebug 看控制台 &#60;html&#62; &#60;input type=&#34;button&#34; value=&#34;send null ajax&#34; onclick=&#34;send();&#34; /&#62; &#60;/html&#62; &#60;script&#62; function send&#40;&#41; &#123; var rq = new XMLHttpRequest&#40;&#41;; rq.open&#40;&#34;POST&#34;, &#34;http://bluehua.org/index.php&#34;, true&#41;; rq.send&#40; null &#41;; &#125; &#60;/script&#62; 两种解决方法: client side : rq.send( data ) -&#62; rq.send( data &#124;&#124; ” ); server side : http://rocky.blog.kingtch.com/2008/11/28/fix_nginx_411_length_required/]]></description>
			<content:encoded><![CDATA[<p>如果您恰好使用了ff浏览器(偶用ff3.0)，server端使用了nginx作代理，而某个ajax又恰好传了一个为null的数据，您就会看到这个错误</p>
<p>firefox下点run code运行下面代码,firebug 看控制台</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;button&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;send null ajax&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;send();&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> send<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003366; font-weight: bold;">var</span> rq <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> XMLHttpRequest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rq.<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;http://bluehua.org/index.php&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
rq.<span style="color: #660066;">send</span><span style="color: #009900;">&#40;</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>两种解决方法:<br />
client side : rq.send( data ) -&gt; rq.send( data || ” );<br />
server side :<a href="http://rocky.blog.kingtch.com/2008/11/28/fix_nginx_411_length_required/" target="_blank"> http://rocky.blog.kingtch.com/2008/11/28/fix_nginx_411_length_required/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/07/23/343.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.349 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-05 03:08:31 -->

