title: Sending and receiving data using Jquery
body: <p>I am at basic level of application development.</p>
  
  <p>I wanted to know how I can send and get this data with JQuery any new version.</p>
  
  <p>I also want it to support all browsers.</p>
  
  <p>I'm just using simple Ajax but I know it is possible with Jquery and im not able to figure it out.</p>
  
  <pre><code>function SendData() {
      var data = "action=check&amp;uid=" + uid + "&amp;fbuid=" + fb_uid + ";
      var url = "http://www.example.com/call.php";
      var ajax = new AJAXInteraction(url, CheckRate);
      ajax.doPost(data);
  };
  
  function CheckRate(Content) {
      response = JSON.parse(Content);
      Rate = response.stat.rate;
      document['getElementById']('ERate')['value'] = Rate;
  };
  
  function AJAXInteraction(url, callback) {
      var req = init();
      req.onreadystatechange = processRequest;
      function init() {
          if (window.XMLHttpRequest) {
              return new XMLHttpRequest();
          }
          else if (window.ActiveXObject) {
              return new ActiveXObject("Microsoft.XMLHTTP");
          }
      }
      function processRequest() {
          if (req.readyState == 4) {
              if (req.status == 200) {
                  if (callback) callback(req.responseText);
              }
          }
      }
      this.doGet = function () {
          req.open("GET", url, true);
          req.send(null);
      }
      this.doPost = function (str) {
          req.open("POST", url, true);
          req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
          req.send(str);
      }
  };
  </code></pre>
  
  <p>I am able to solve first part And still dont know rest:</p>
  
  <pre><code>function SendData(){
      dataString = "action=check&amp;uid=" + uid + "&amp;fbuid=" + fb_uid + ";
      url = "http://www.example.com/call.php";
      jQuery.ajax({
          type: "POST",
          url: url,
          data: dataString,
      });
  };
  </code></pre>
  
  <p>My problem is how i will read response </p>
  
  <pre><code>function CheckRate(Content) {
      response = JSON.parse(Content);
      Rate = response.stat.rate;
      document['getElementById']('ERate')['value'] = Rate;
  };
  </code></pre>