title: getJSON and return the value string
body: <p>i would like to get string with <strong>getJSON</strong> 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.</p>
  
  <pre><code> function getValues() {
         $.getJSON("layout.php",function(result){
           return result;    // this should be the return value
         });
   }
  
  
   var jsonString = getValues();
   alert(jsonString);
  </code></pre>
  
  <p>This is my layout.php document with JSON string</p>
  
  <pre><code>{"bigfield0":{"field0":{"collapse":"false"},"field1":{"collapse":"true"}},"bigfield1":{"field2":{"collapse":"false"}}}
  </code></pre>