Jquery, No X-Requested-With=XMLHttpRequest in ajax request header?
<p><strong>SOME TIMES</strong> there is no X-Requested-With header, sometimes there is.</p>

<p>I checked in firebug and found that, don't know why.</p>

<p>So when I use request.is_ajax in django, it fails sometimes.</p>

<p>Anyone know how to fix it?</p>

<p><hr></p>

<p>OK, now it happened again.
I opened the page and then left for supper for <strong>a long while</strong>, when I came back, it happened again. I recorded request header in firbugs:</p>

<p>Request without X-Requested-with:</p>

<blockquote>
  <p>Host  localhost:8000<br />
  User-Agent    Mozilla/5.0 (Windows; U;
  Windows NT 5.2; zh-CN; rv:1.9.1.5)
  Gecko/20091102 <br /> Firefox/3.5.5 Accept text/html, <em>/</em><br />
  Accept-Language   zh-cn,zh;q=0.5<br />
  Accept-Encoding   gzip,deflate<br />
  Accept-Charset    GB2312,utf-8;q=0.7,*;q=0.7<br /> Keep-Alive 300<br />
  Connection    keep-alive<br />
  X-Requested-With  XMLHttpRequest<br />
  Referer   <a href="http://localhost:8000/gallery/">http://localhost:8000/gallery/</a><br />
  Cookie    xxx<br /></p>
</blockquote>

<p>Request with X-Requested-with:</p>

<blockquote>
  <p>Host  localhost:8000<br />
  User-Agent    Mozilla/5.0 (Windows; U;
  Windows NT 5.2; zh-CN; rv:1.9.1.5)
  Gecko/20091102 <br /> Firefox/3.5.5
  Accept    text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8 Accept-Language    zh-cn,zh;q=0.5 Accept-Encoding    gzip,deflate<br />
  Accept-Charset    GB2312,utf-8;q=0.7,*;q=0.7<br /> Keep-Alive 300<br />
  Connection    keep-alive<br />
  Referer   <a href="http://localhost:8000/gallery/">http://localhost:8000/gallery/</a><br/> 
  Cookie    xxx<br /></p>
</blockquote>
