当我的asmx webservice位于不同的域中时,下面的代码似乎不起作用。有什么我失踪?使用JQuery进行跨域Ajax调用
function CallGreet() {
$.ajax({
type: "POST",
url: "http://test.me/TestWebService.asmx/HelloWorld",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
error: OnError
});
}
谢谢...
你使用Chrome? Chrome不允许跨网域使用网络服务。使用JSon。 – 2011-04-07 05:37:50