title: How to get json data in javascript
body: <p>I am getting the values from database in php and encoded the retrieved values to json data format.</p>
  
  <p>php code:</p>
  
  <pre><code>&lt;?php
  require_once('config.php');
  if(! $conn )
  {
    die('Could not connect: ' . mysql_error());
  }
  $sql = 'SELECT * FROM theater';
  mysql_select_db($dbname);
  $retval = mysql_query( $sql, $conn );
  if(! $retval )
  {
    die('Could not get data: ' . mysql_error());
  }
  while($row = mysql_fetch_assoc($retval))
  {
  echo json_encode($row) "\r\n"; 
  }
  mysql_close($conn);
  ?&gt;
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>{"id":"11","region":"Central","cord_latitude":"12.9237","cord_longitude":"77.5535"}
  </code></pre>
  
  <p>now i need to get only some values from the json data to javascript. 
  I need only cord_latitude and cord_longitude values in javascript
  how can i get those values in javascript?</p>