Software Archive
Read-only legacy content

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

nicolas_r_
Beginner
411 Views

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();

});    
0 Kudos
1 Solution
Diego_Calp
Valued Contributor I
411 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

0 Kudos
3 Replies
Diego_Calp
Valued Contributor I
412 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

0 Kudos
nicolas_r_
Beginner
411 Views

thanks diego =) 

0 Kudos
Chris_P_Intel
Employee
411 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
})

 

0 Kudos
Reply