connection to database with phonegap

0

Good morning everyone, we are studying phonegap a powerful framework cross-platform and easy to design, what I do not understand is the connection to a database through ajax or jquery . I put something of what I wear and I hope you can please help me with my doubt that is driving me crazy.

I have a login form, the classic:

                          Code                                        Nip                                              

and my function with jquery to pass the data to my server and be able to communicate it with the login.php file that validates. which is inside the body so that the button can recognize it

<script>
function enviar_variables(){
    var datosCodigo = $("#codigo").val();
    var datosNip = $("#nip").val();

    $.post("https://juanssa91.000webhostapp.com/proyecto/login.php", {codigo:datosCodigo, nip:datosNip}, function(respuesta){
        alert(respuesta);
    });
}     
</script>

Well, it happens that when the executable shows the interface, I try to insert the data, I press the button, but nothing, it does not do anything.

    
asked by juan sosa 01.12.2017 в 07:57
source

1 answer

0

As you have formed the question, it seems evident that there is a lot of code that you are not showing us. Please try to show more code.

In any case, if you do nothing, it's probably because you have not linked the execution of the function to any HTML event.

Although, with the code you have contributed, this is no more than a simple assumption.

    
answered by 01.12.2017 в 08:45