title: HTTP methods in PhoneGap
body: <p>What is the best way to make HTTP GET in PhoneGap? I don't want to use Java for this, so now the question is whether it should be done in jQuery, or in JavaScript. I read that JavaScript in PhoneGap is mostly used for UI events. Is there any other way to accomplish HTTP GET in PhoneGap?</p>
  
  <p>EDIT: In the book written by Andrew Lunny (<em>PhoneGap Beginner's Guide</em>), author mentions and gives examples about how to access remote resources utilizing Twitters search API - making HTTP requests to the server. In this case it is not very useful to me, because he is getting JSON object as a response from server. In my application I need strict html body as a response.</p>
  
  <p>EDIT(as proposed by codemonkey and Simon MacDonald):</p>
  
  <pre><code>&lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.css" /&gt;  
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  $.get('http://www.google.com', function(data) {
        alert(data);
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>In this case question followed out of proposal:</p>
  
  <p>Should I be using external libraries (jQuery-mobile/jQuery) or is it better to include them in the project. Of course with the first proposal I will force user to download libraries every time he will be forced to use them, which is a little inefficient, or should I just include them in the project? In this case, what is the proper location in the project(file system) to put jQuery libraries, '<em>www</em>', '<em>libs</em>', '<em>res</em>', etc.?</p>
  
  <p>As with the proposal of Simon MacDonald:</p>
  
  <pre><code>&lt;script&gt;
  function get() {
          var request = new XMLHttpRequest();
          request.open("GET", "http://www.google.com", true);
          request.onreadystatechange = function() {
              if (request.readyState == 4) {
                  if (request.status == 200 || request.status == 0) {
                      // -&gt; request.responseText &lt;- is a result
                  }
              }
          }
          request.send();
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Advantage: No additional libraries are needed</p>