1
I’m using the following function:
$( document ).ready(function() {
var $server;
$server = 'http://localhost/mobile/DatabaseXDK/database/www/';
$('#inclusao').on('click', function(){
$nome = $('#nome').val();
$.ajax({
type: "get",
url: $server+"/conexao.php",
timeout: 3000,
contentType: "application/json; charset=utf-8",
data: "nome="+$nome+"&acao=inclusao",
success: function(data) {
intel.xdk.notification.alert('Pessoa Cadastrada!','Inclusao','ok');
Pessoas();
}
});
});
Until then beauty, perfect wheel, but if I put some more field as, surname, does not include anything in the surname. See function:
$( document ).ready(function() {
var $server;
$server = 'http://localhost/mobile/DatabaseXDK/database/www/';
$('#inclusao').on('click', function(){
$nome = $('#nome').val();
$sobrenome = $('#sobrenome').val();
$.ajax({
type: "get",
url: $server+"/conexao.php",
timeout: 3000,
contentType: "application/json; charset=utf-8",
data: "nome="+$nome+"sobrenome"+sobrenome+"&acao=inclusao",
success: function(data) {
intel.xdk.notification.alert('Pessoa Cadastrada!','Inclusao','ok');
Pessoas();
}
});
});
Shouldn’t be
"nome="+$nome+"&sobrenome"+sobrenome+"&acao=inclusao"
see that there is a&
before the surname.– rray
It seems you forgot the dollar and the & "name="+$name+"&last name"+$last name+"&action=inclusion",
– Max Rogério