开发者

Jquery + WCF and different results in Chrome and Firefox

Running a simple JQuery.get (Version 1.6.2) against a C# WCF Service which returns a list of values. The service is effectively cross domain so I have set the WCF service to handle the origin policy and that's working fine.

What isn't working is a simple get against the service.

$.get("http://localhost:4858/SomeService.svc/GetDepartments", function (response) {
        console.info(response);
        console.info(response.d);
}}, 'json');

The response object is different between Chrome and Firefox.

Chrome: ["Accounting","Maintenance","S开发者_JS百科upply"]

Firefox: ({d:["Accounting", "Maintenance", "Supply"]})

Given that it comes from the same service I'm not expecting it to be different between browsers. Does anyone know why the above is happening and what the best method of handling it would be?


It seems the XSS controls within the various browsers have everything to do with it.

As we have multiple browsers in our environment I've changed tack and consolidated the endpoints under IIS and everything is working just fine once XSS is out of the way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜