i would like to get string with getJSON function from my JSON document. I tried to return the value by everytime it return undefined. This is my code below. Thank you for your help.
function getValues() {
$.getJSON("layout.php",function(result){
return result; // this should be the return value
});
}
var jsonString = getValues();
alert(jsonString);
This is my layout.php document with JSON string
{"bigfield0":{"field0":{"collapse":"false"},"field1":{"collapse":"true"}},"bigfield1":{"field2":{"collapse":"false"}}}