我尝试连接到此网络服务:
但它警告“错误”
这是我使用的脚本:
var varType;
var varUrl;
var varData;
var varContentType;
var varDataType;
var varProcessData;
function SetValue() {
varType = "POST";
varUrl = "http://www.w3schools.com/webservices/tempconvert.asmx/FahrenheitToCelsius";
varData = '{"Fahrenheit":"230"}';
varContentType = "application/json; charset=utf-8";
varDataType = "json";
varProcessData = true;
CallService();
}
function CallService() {
$.ajax({
type: varType,
url: varUrl,
data: varData,
contentType: varContentType,
dataType: varDataType,
processdata: varProcessData,
success: function (msg) {
ServiceSucceeded(msg);
},
error:function (xhr, ajaxOptions, thrownError){
alert(xhr.statusText);
alert(thrownError);
}
});
}
function ServiceSucceeded(result) {
alert("ServiceSucceeded");
varType = null; varUrl = null; varData = null; varContentType = null; varDataType = null; varProcessData = null;
}
我该怎么办?