hello all i have this code
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
but temp is undefined after the execution of getJson...if i put an alert(temp) it continues whats going on? how can i take the value of temp to continue?
thanks in advance!