title: Parse response from url in json
body: <p>How can i parse this url which gives Json response ?</p>
  
  <pre><code> $.getJSON('http://url.php?id=chat_init&amp;sess_d='+sessionID+'&amp;user_id='+document.getElementById("user_id").value+    '&amp;to_id='+document.getElementById("to_id").value,function (data) {
  
           alert(data.status);
           alert(data.msg);
           alert(data.room_id);
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>{"status":1,"msg":"chat is initilize","room_id":13}
  
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
  //&lt;![CDATA[
      var sessionID=null ; 
      function A() { 
          $.getJSON('url.php?id=login&amp;email='+document.getElementById("txtemail").value+'&amp;password='+document.getElementById("txtpassword").value, function (data) { 
              sessionID = data.session_id;
              alert(data.status);
              alert(data.msg);
              alert(data.user_id);
              alert(sessionID);
          });
      }
  
      function B() {
          $.ajax({
              type: 'GET',
              url: 'url.php', 
              dataType: 'json',
              data: { 
                  id: 'chat_init',
                  sess_d: sessionID,
                  user_id: $("#user_id").val(), 
                  to_id: $("#to_id").val() 
          },success: function(data) { 
              alert(data.status); 
              alert(data.msg);
              alert(data.room_id); 
          }
      });
  
      //]]&gt;
      &lt;/script&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
      Username :
  
      &lt;form&gt;
          &lt;input type="text" id="txtemail" /&gt;
          &lt;br /&gt;&lt;br /&gt;
  
          Password : &lt;input type="password" id="txtpassword" /&gt;
          &lt;br /&gt;
  
          &lt;input type="button" value="Login" onclick="A()" /&gt;
          &lt;br /&gt;
  
          My id is : &lt;input type="text" id="user_id" /&gt;
          &lt;br /&gt;&lt;br /&gt;
  
          To ID is : &lt;input type="text" id="to_id" /&gt;
          &lt;br /&gt;&lt;br /&gt;
  
          &lt;textarea rows="10" cols="25"&gt;&lt;/textarea&gt;
          &lt;br /&gt; &lt;br /&gt;
  
          &lt;textarea rows="2" cols="18"&gt;&lt;/textarea&gt;
  
          &lt;input type="button" value="Initialize chat" onclick="B()" /&gt;
  
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thankx for any help...</p>