Software Archive
Read-only legacy content
17060 ディスカッション

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

nicolas_r_
ビギナー
2,123件の閲覧回数

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 件の賞賛
1 解決策
Diego_Calp
高評価コントリビューター I
2,123件の閲覧回数

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

元の投稿で解決策を見る

3 返答(返信)
Diego_Calp
高評価コントリビューター I
2,124件の閲覧回数

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

nicolas_r_
ビギナー
2,123件の閲覧回数

thanks diego =) 

Chris_P_Intel
従業員
2,123件の閲覧回数

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
})

 

返信