最近在写网站,整站采用gbk编码。今天调整架构,以前好好的ajax不能获取内容了,每次取得内容都是空
可是我用ajax请求的那个url却可以在浏览器取得内容。
我的ajax请求为index?content=json数据&c=user&a=login
这种格式,c和a分别表示类和函数,我动态加载起来的,然后用echo输出内容不知道ajax调用这种是否可以,谢谢下面是firebug的一些数据:
响应头信息
Date        Mon, 07 Sep 2009 11:12:53 GMT
Server        Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
X-Powered-By        PHP/5.2.9
Expires        Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control        no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma        no-cache
Content-Length        0
Keep-Alive        timeout=5, max=100
Connection        Keep-Alive
Content-Type        text/html; charset=gbk
请求头信息
Host        localhost
User-Agent        Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
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,deflate
Accept-Charset        GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive        300
Connection        keep-alive
Content-Type        application/x-www-form-urlencoded; charset=UTF-8
Referer        http://localhost/anyoweb/register.php
Content-Length        50
Cookie        clear=1; mailid=0; province=118; city=101120101; XDEBUG_SESSION=ECLIPSE_DBGP_12523201960632; PHPSESSID=ac85a8110955bf74855beef2932bfeb5
PostPut响应缓存HTML
响应头信息
Date        Mon, 07 Sep 2009 11:12:53 GMT
Server        Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9
X-Powered-By        PHP/5.2.9
Expires        Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control        no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma        no-cache
Content-Length        0
Keep-Alive        timeout=5, max=100
Connection        Keep-Alive
Content-Type        text/html; charset=gbk
请求头信息
Host        localhost
User-Agent        Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
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,deflate
Accept-Charset        GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive        300
Connection        keep-alive
Content-Type        application/x-www-form-urlencoded; charset=UTF-8
Referer        http://localhost/anyoweb/register.php
Content-Length        50
Cookie        clear=1; mailid=0; province=118; city=101120101; XDEBUG_SESSION=ECLIPSE_DBGP_12523201960632; PHPSESSID=ac85a8110955bf74855beef2932bfeb5post内容
a        checkuser
c        user
content        {"username":"sdsfgs55"}响应没有内容,很纳闷