ajax json的怪问题

单车大叔LKLM 2009-09-07 07:37:31
最近在写网站,整站采用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=ac85a8110955bf74855beef2932bfeb5

post内容
a checkuser
c user
content {"username":"sdsfgs55"}

响应没有内容,很纳闷
...全文
86 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tony-杨 2009-09-07
  • 打赏
  • 举报
回复
....
YHL27 2009-09-07
  • 打赏
  • 举报
回复
sf!!
单车大叔LKLM 2009-09-07
  • 打赏
  • 举报
回复
找到问题了,我ajax是post上去的数据

我在php后端用get拿的,没有拿到数据

看来以后得小心了

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧