title: ajax code cannot access json responds from php
body: <p>this is my ajax call</p>
  
  <pre><code>&lt;script src = "js/jquery.js" type = "text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  
  $(document).ready(function(){
  
      $('#DepartmentNameDropdown').change(function(){
  
          $('#DepartmentName').attr('value', document.getElementById("DepartmentNameDropdown").options[document.getElementById("DepartmentNameDropdown").selectedIndex].text);                                 
  
      $.ajax({
          type: "POST",
          dataType: "json",
          url: "http://localhost:8081/crownregency/getInfo.php",
          data: {id : $('#DepartmentNameDropdown').val()}, //data: {status: status, name: name},
          success:function(data){
              $('#DepartmentDescription').attr('value', data.Desc);
          }           
      });
  });                    
  });
  $('#DepartmentName').attr('value', $('#DepartmentNameDropdown').text());    
  
  &lt;/script&gt;
  </code></pre>
  
  <p>this is my getinfo.php</p>
  
  <pre><code>&lt;?php
  mysql_connect("localhost", "root", "");
  mysql_select_db("jkings");
  $value = $_POST['id'];
  $query = mysql_query("SELECT * FROM department WHERE dept_ID = $value");
  $row = mysql_fetch_array($query);
  $desc = $row['dept_desc'];
  $mission = $row['dept_mission'];
  $struct = array('Desc' =&gt; '$desc', 'Mission' =&gt; '$mission');
  session_start();
  $_SESSION['id'] = $value;
  
  echo json_encode($struct);
  //echo $row['dept_desc'];
  ?&gt;
  </code></pre>
  
  <p>I do not know where in the code i made a mistake but it seems i can't access the json responds. i have tried different ways to this, i am still learning this ajax and json so it is hard for me to see where i made a mistake</p>