Created
February 4, 2016 02:48
-
-
Save suneo3476/d3256edc7624958f36b3 to your computer and use it in GitHub Desktop.
why undefined???
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var func = function(str,id){ | |
var request = $.ajax({ | |
type: "get", | |
url: "get_hogehge.php", | |
data: {id: id} | |
}); | |
request.done(function(data){}); | |
request.always(function(data){ | |
var result = "仮"; | |
console.log(result);// -> 仮 | |
console.log(typeof(result));// -> str | |
return result; | |
}); | |
} | |
var ret_func = func(str,id); | |
console.log(ret_func); //-> undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment