Community
cancel
Showing results for 
Search instead for 
Did you mean: 
nicolas_r_
Beginner
114 Views

the alert message doesn't show when function success javaScript using intel xdk and php

Jump to solution

hi im trying to add info to a data base whit PHP it works in the DB i get the new register but it doesn't show the alert massage confirming that was all ok. 

$( document ).ready(function() {
var $server;
$server = 'http://localhost:8888/registro/www/';

 $('#inclusao').on('click', function(){
    $id = $('#id').val(); 
    $nome = $('#nome').val();
    $sobrenome = $('#sobrenome').val(); 

    $.ajax({
        type: "get",
        url: $server+"/conecta.php",     
        data: "id="+$id+"&nome="+$nome+"&sobrenome="+$sobrenome+"&acao=inclusao",
        success: function(data) {
        intel.xdk.notification.alert('Usuário Cadastrado!','Aviso!','OK');
            Lista();
        }
    });
});


function Lista(){
       $.ajax({

           type: "get",
           dataType  : 'html',
           url: $server+"/conecta.php",
           data: "acao=listarusuario",
           success: function(data) {
                $('#listarusuario').html(data);
            }
       });
}

Lista();

});    
Tags (2)
0 Kudos
1 Solution
Diego_Calp
Valued Contributor I
114 Views

Hi Nicolas,

intel.xdk.notification api is deprecated, you should use another way to display an alert.

Take a look if the framework you are using provides dialogs. For testing purposes the simple javascript alert() may work.

Regards,
Diego

View solution in original post

3 Replies
Diego_Calp
Valued Contributor I
115 Views

Hi Nicolas,

intel.xdk.notification api is deprecated, you should use another way to display an alert.

Take a look if the framework you are using provides dialogs. For testing purposes the simple javascript alert() may work.

Regards,
Diego

View solution in original post

nicolas_r_
Beginner
114 Views

thanks diego =) 

Chris_P_Intel
Employee
114 Views

And you should have a failure handler as well.

$.ajax( {options} )  //<-- same options, except no success handler
.fail(function(er){
  // do something
})
.then(function(data)
{
//this is the success handler
})

 

Reply