title: phonegap ajax call getting error '$ is not defined'
body: <p>I am making an AJAX request in my Phonegap application. The code is:</p>
  
  <pre><code>function remoteCall()
  {
    alert("Remote call func called");
  
    try
    {
      $.ajax({
         url: 'http://192.168.1.200/testing/testConn.php',
         contentType: "application/json; charset=utf-8",
         dataType:"json",
         success: function(data)
         {
            if(data == '')
                alert("No data received from server");
            else
            alert("Data received from server = "+data.postcode);
         },
         error: function(jqXHR, textStatus, errorThrown)
         {
             console.log(textStatus);
             alert('FAIL !!!');
         },
  
       });
    }//end of try().
    catch(e)
    {
          alert("error = "+e.message);
    }
  
  }//END OF FUNC remoteCall.
  </code></pre>
  
  <p>I have also added the following line in <code>&lt;head&gt;</code> to avoid the jQuery conflict.</p>
  
  <pre><code>&lt;script&gt;jQuery.noConflict();&lt;/script&gt;
  </code></pre>
  
  <p>My server side file is:</p>
  
  <pre><code>&lt;?php
  
  header("Access-Control-Allow-Origin: *");
  header("Access-Control-Allow-Headers: X-Requested-With");
  
  $retArray = array();
  $retArray['postcode']= 'm14';
  $retArray['brand']= '1';
  $retArray['product_type']= '1';
  
  $jsondata =  json_encode($retArray);
  
  return $jsondata;
  ?&gt;
  </code></pre>
  
  <p>I am getting first alert message but later I am getting the error, "$ is not undefined". I have no idea how to fix this; can anyone help?</p>
  
  <p>I am able to overcome that error of "$ is undefined", now i am not getting any errors and also I am not getting any output...</p>