0
I need to get a phonegap. At the end of the URL I would like to add the device ID to see if it is already registered or not in the database. For sending I use the Ajax function of Jquery. Below follows the Code:
<script>
window.onload = function(){
document.addEventListener('deviceready', iniciar);
function iniciar(){
console.log('App Iniciado');
};
};
$(document).ready(function(e){
var a = device.serial;
$.ajax({
type: 'GET',
url: "https://localhost/aulaphonegap/consulta.php?s="+a,
dataType:'json',
timeout:5000,
success: function(e){
if(e.Resp == 1){
console.log(e.Resp);
}else{
console.log("Segunda Opção");
}
},
error: function(e) {
alert('Aviso!: ' + e.message);
}
})
});
from what I understand your code already picks up the serial you want to do the validation in the correct database?
– Giovanni Dias
Yeah, that’s right.
– Paulo Bolsanello
Your question "How to Catch Device Serial on PHONEGAP?" is no longer answered with the
var a = device.serial;
?– Ricardo Pontual
It didn’t work that way. Returns Empty
– Paulo Bolsanello