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执行后未定义......如果我把警报(临时)继续怎么回事?我怎样才能把温度值继续下去?
在此先感谢!