我检查了firebug,发现,不知道为什么.
所以当我在django中使用request.is_ajax时,它有时会失败.
任何人知道如何解决它?
好的,现在又发生了.
我打开了页面,然后离开了晚饭了很久,当我回来的时候又发生了.我在firbugs中记录了请求头:
请求与X请求与:
Host localhost:8000
User-Agent Mozilla/5.0 (Windows; U; Windows
NT 5.2; zh-CN; rv:1.9.1.5) Gecko/20091102
Firefox/3.5.5
Accept text/html,/
Accept-Language zh-cn,zh;q=0.5
Accept-Encoding gzip,deflate
Accept-Charset GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
X-Requested-With XMLHttpRequest
Refererhttp://localhost:8000/gallery/
Cookie xxx
无需X请求的请求:
Host localhost:8000
User-Agent Mozilla/5.0 (Windows; U;
Windows NT 5.2; zh-CN; rv:1.9.1.5)
Gecko/20091102
Firefox/3.5.5
Accept text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language zh-cn,zh;q=0.5 Accept-Encoding gzip,*;q=0.7
Keep-Alive 300
Connection keep-alive
Refererhttp://localhost:8000/gallery/
Cookie xxx