From ee2ae91d10b4b317888e29b07052f4b450531eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BA=A6=E5=BD=93=E8=8B=97=E5=84=BF?= Date: Thu, 18 Apr 2013 21:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E8=8C=83=20JSONP=20=E5=92=8C=20EVAL?= =?UTF-8?q?=20=E7=9A=84=20ContentType=20=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Library/Think/Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Think/Controller.php b/Library/Think/Controller.php index 9d5a4c0a..d86a3c4f 100644 --- a/Library/Think/Controller.php +++ b/Library/Think/Controller.php @@ -91,12 +91,12 @@ class Controller { exit(xml_encode($data)); case 'JSONP': // 返回JSON数据格式到客户端 包含状态信息 - header('Content-Type:application/json; charset=utf-8'); + header('Content-Type:application/javascript; charset=utf-8'); $handler = isset($_GET[C('var_jsonp_handler')]) ? $_GET[C('var_jsonp_handler')] : C('default_jsonp_handler'); exit($handler . '(' . json_encode($data) . ');'); case 'EVAL': // 返回可执行的js脚本 - header('Content-Type:text/html; charset=utf-8'); + header('Content-Type:application/javascript; charset=utf-8'); exit($data); default: // 用于扩展其他返回格式数据