text/html json,Jquery ajax text/html to application/json

I have an error on using the ajax request below.

$.ajax({

url: "http://webservice.users.com:8000/users",

dataType: 'jsonp',

beforeSend: function (xhr) {

xhr.setRequestHeader("Authorization", "Basic b2d1e77hbi5lcmVu1BhczRVYg");

},

success: function (json) { console.log(json); },

error: function (httpReq, status, exception) {

console.log(status + " " + exception);

}

});

My call is cross-domain and it result is text/html (maybe jquery can't convert result to application/json)

Console errors:

parsererror Error: jQuery18206287364205345511_1351595013388 was not called

Error: "SyntaxError: Unexpected token : " in chrome browsers.

Chrome Developer Tools service response headers:

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Connection:Keep-Alive

Content-Encoding:gzip

Content-Length:180

Content-Type:text/html

Date:Tue, 30 Oct 2012 10:36:57 GMT

Expires:Thu, 19 Nov 1981 08:52:00 GMT

Keep-Alive:timeout=15, max=100

Pragma:no-cache

Server:Apache/2.2.16 (Debian)

Set-Cookie:active_style=style; expires=Wed, 30-Oct-2013 10:36:57 GMT

Vary:Accept-Encoding,User-Agent

Server response body:

{

"data": {

"islogin": "0"

},

"userdata": {

"login": "0"

},

"rstatus": {

"status": "0",

"errno": "5555",

"mesg": "blablabla"

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值