title: Using Get HTTP Request using Jquery and Ajax
body: <p>I have the below code and am trying to pass through data with a GET HTTP Request using Jquery and Ajax. When typing in "Example" in the text box and clicking "Go", I would expect "example" to come back in the feedback div. Nothing is being returned though. I would appreciate any help on why this would not be working. Thanks.</p>
  
  <p>File name is "trial.php" </p>
  
  <pre><code>&lt;body&gt;
  &lt;script type="text/javascript" src="jquerycode.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="ajax.js"&gt;&lt;/script&gt;
  &lt;input id = "string" type = "text" /&gt; 
  &lt;input id = "button" type = "button" value = "Go" /&gt;
  &lt;div id = "feedback"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>File name is "ajax.js"</p>
  
  <pre><code>$('#button').click(function()
  {
  var string = $('#string').val();
  
  $.get('file.php', { input: string }, function(data) {  
  $('#feedback').text(data);
  });
  });
  </code></pre>
  
  <p>File name is "file.php"</p>
  
  <pre><code>&lt;?php
  if(isset($_GET['input']))
  {
  $string = $_GET['input'];
  echo strtolower($string);
  }
  ?&gt;
  </code></pre>