I am trying to send xhr using phonegap to a blackberry. Currently, when I make a request, it fails. I tried using jQuery jQuery.getJSON(url , callback),
xhr object
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange=function(){
if(xmlhttp.readyState==4){
if(xmlhttpForTGT.status==200){
response = xmlhttpForTGT.getResponseText()
}
else{
alert("Request Failed")
}
}
}
xmlhttp.open("GET", url , true)
xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
xmlhttp.send()
and xui
x$('#home').xhr(url,
{method: 'get',
callback: function(){ alert('made request') }});
and still i can't get them to work. Could anyone else get xhr to work? I am using JRE4.6.1 and am using eclipse for the development environment. No errors occur when I try to fulfill requests, any advice?
source
share