Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $("form").submit(function() {
- var user = $("#nick").val();
- var pass = $("#password").val();
- event.preventDefault();
- $.ajax({
- type: "POST",
- url: "consulta.php",
- data: "nick="+user+"&password="+pass,
- dataType: "json",
- success: function(data){
- $("#resultado").html(data.nick);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- console.log("ERRORRES ENCONTRADOS ==> ",jqXHR, textStatus, errorThrown);
- document.getElementById("resultado").innerHTML = "Error al realizar la consulta a la base de datos";
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement