當我的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