header('Content-Type:application/json'); // 旧版本IE不认。jq用法也有问题。$.post(URL+"/showLogList",function(data)
{
alert(data.info);
}, 'json');
{
alert(data.info);
}, 'json');
解决方案 »
- wordpress运行机制和代码怎么看呀???好着急!!需要介绍程序运行的详细资料!!
- php 获取google收录页面数量
- 控件隐藏却不工作了,在html中是可以的
- php-[function.fopen]: failed to open stream: Permission denied都改了为什么还出这样的问题
- 为memcached开发的tag功能【支持php扩展】
- 怎么设定textarea的值不能为空
- 请大家帮忙推荐下选用的框架
- shtml文件include一个文件出错
- 请大家把自己的经常用的技巧和常用函数贴上来,方便大家参考和使用!(贴者有分)
- 作业完不成了,请帮帮我吧!!
- 工行最新接口 求高手指点
- 请教如何实现PHP修改html文件任意内容后保存原文件名??
按照你说的我改成了你说的这样,同时将header('Content-Type:application/json; charset=utf-8'); 修改为
header('Content-Type:text/html; charset=utf-8');
但是结果为什么只打印在页面上而没有 alert 出来{"status":1,"info":"\u4f60\u6709\u672a\u5b8c\u6210\u7684\u9009\u9879"}为什么不alert
我用了firefox,效果是只显示返回的数据,不会alert返回数据: {"status":1,"info":"\u4f60\u6709\u672a\u5b8c\u6210\u7684\u9009\u9879"}我不知道为什么不alert 奇怪
if(empty($type)) $type = C('DEFAULT_AJAX_RETURN');
switch (strtoupper($type)){
case 'JSON' :
// 返回JSON数据格式到客户端 包含状态信息
header('Content-Type:application/json; charset=utf-8');
exit(json_encode($data));改成 text/html去掉程序文件的 BOM 头