0
您好所有我有這樣的代碼的getJSON問題,它返回undefined
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執行後未定義......如果我把警報(臨時)繼續怎麼回事?我怎樣才能把溫度值繼續下去?
在此先感謝!