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?
EDIT: In the book written by Andrew Lunny (PhoneGap Beginner's Guide), 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.
EDIT(as proposed by codemonkey and Simon MacDonald):
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script>
<script type="text/javascript">
$.get('http://www.google.com', function(data) {
alert(data);
});
</script>
In this case question followed out of proposal:
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, 'www', 'libs', 'res', etc.?
As with the proposal of Simon MacDonald:
<script>
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) {
// -> request.responseText <- is a result
}
}
}
request.send();
}
</script>
Advantage: No additional libraries are needed