【发布时间】:2012-09-07 23:48:12
【问题描述】:
在 Chrome 上运行我收到以下错误消息:
Uncaught SyntaxError: Unexpected token
这是我的代码中负责请求的部分:
function wetter() {
$.ajax({
'Accept': 'application/json',
type: 'GET',
url: '[here comes the url',
dataType: 'jsonp',
success: function (data) {
//content
}
});
};
【问题讨论】:
-
success函数块内是否还有其他可能导致问题的代码 -
可能不喜欢你的
'Accept'。它告诉你错误在哪一行? -
chrome 告诉我错误在 json 中
标签: javascript json jsonp