The code below works fine using the wamp server on localhost. It calls the php file, which connects to the MySql database and returns the data.
However, I am trying to create a mobileapp using PhoneGap. The code below is in the HTML file. My questions are: how will my html file establish a connection to the server using ajax as soon as I load it into the phone records and generate the .apk file. Since the code below simply calls the getbustime.php file without any web server settings.
I developed my phone recording application using HTML, jQueryMobile, Ajax and now want to download help?
function getBusTime(){
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("resultLogBus").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","getbustime.php?direction="+direction+"&busnum="+busnum+"&dayofweek="+dayofweek+"&stopname="+stopname+"&starttime="+starttime+"&endtime="+endtime,true);
xmlhttp.send();
}
</script>