Thursday, 8 August 2013

jQuery return value from function

jQuery return value from function

I want to return a value from a function, like
var value = uberFunction()
uberFunction() {
var institutValues = "nix"
$.getJSON(jsonFile,function(data) {
$.each(data.fakultaeten, function(key,value){
$.each(value.institut[0], function(key1, value1){
if(value1[0].subID == selectedInstitut) {
return institutValues
}
});
});
});
return institutValues
}
How is that possible? I'm struggling with all the return / return false
stuff :(

No comments:

Post a Comment