73
rated 0 times
[
76]
[
3]
/ answers: 1 / hits: 30865
/ 13 Years ago, wed, january 11, 2012, 12:00:00
I've this function
function getTags(level){
$.getJSON(php/get-tags.php, { parent: level }, function(json) {
return json;
});
}
I'm calling this function as
$(function(){
var tags = getTags('0');
});
The problems is, in the function getTags()
the return json
is like
{tags:[Mathematics,Science,Arts,Engineering,Law,Design]}
but at var tags = getTags('0')
, catching the return value, it gets an undefined
value.
Is the way I'm returning the value incorrect?
More From » jquery