は、私は、このWebサービスへの接続を試みた:
が、それは
に "エラー" を警告これは、私が使用したスクリプト:
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;
}
どうすればよいですか?によって
の
dataType: 'jsonp'
を使用する必要が –あなたは 'null'にすべてを設定する必要はありません...ガベージコレクタはそれを処理します。 – Ryan
あなたはfirebug/webinspectorで正確に戻ってきていますか?あなたはプリセット変数でコンソールから手動でこれをやろうとしましたか? – alonisser