javascript - $.AJAX to $.POST -
can me convert code $.post,any code replace not functioning. thank
$.ajax({ type: "post", url: "http://192.168.254.107/webs/main/ajax/validatelogin.php", data: senddata, success: function(data) { $("#info").html(data); var returnmessage = data; var mes = returnmessage.tostring().trim(); if (mes != "" && mes != "invalid login!") { localstorage.setitem("message", returnmessage); window.localstorage.setitem("username", username); window.localstorage.setitem("data", data); document.location.href = "trackme.html"; } else { alert(mes); } } });
how this:
$.post('http://192.168.254.107/webs/main/ajax/validatelogin.php', senddata, function(data) { $("#info").html(data); var returnmessage = data; var mes = returnmessage.tostring().trim(); if (mes != "" && mes != "invalid login!") { localstorage.setitem("message", returnmessage); window.localstorage.setitem("username", username); window.localstorage.setitem("data", data); document.location.href = "trackme.html"; } else { alert(mes); } });
Comments
Post a Comment