こんにちは、私はこのコードgetJsonの問題は、それが未定義
var temp;
if(method==1)
temp = $("#Words").val(); //get the words from textbox
else{
$.getJSON("http://localhost/mine/test.js", function(data) {
temp=data.Words;
});
}
//do something with temp...but temp is undefined after the execution of else
を持っていますが、一時はgetJsonの実行後に定義されていない...私は警告(TEMP)を入れた場合に起こっていただきました、それは継続?すべてを返しますか。私はtempの価値をどのように受け継ぐことができますか?
ありがとうございます!