i have problem login in application. when try login see error :
"error: function (responsedata, textstatus, errorthrown) { alert('post failed.');"
i don't know why doing that.
<script type="text/javascript"> $(document).ready(function() { $("#loginform").on("submit",function(e) { $("#submitbutton",this).attr("disabled","disabled"); var u = $("#username", this).val(); var p = $("#password", this).val(); if(u != '' && p!= '') { var loginusermodel = { login: u, password: p } $.ajax({ type: "post", url: /login", datatype: "json", crossdomain: true, data: loginusermodel, success: function(data) { console.log(data); console.log(data); if (data) { console.log('elo'); } else{ navigator.notification.alert("your login failed", function() {}); console.log('nie'); } $("#submitbutton").removeattr("disabled"); console.log('elo'); }, error: function (responsedata, textstatus, errorthrown) { alert('post failed.'); } }); } }); }); </script>
someone know problem because don't have idea. why can't login in application? thanks
- add opening quotation on /login"
- set contenttype: "application/json"
- set data: json.stringify(loginusermodel)
after making change, @ network/console tab in browser developer tools.