Guest User

Untitled

a guest
Apr 9th, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. var host="http://localhost/";
  2. window.onload = function()
  3. {
  4. document.addEventListener("deviceready", init, false);
  5. }
  6. function init()
  7. {
  8. var myButton = document.getElementById("navigateButton");
  9. myButton.addEventListener("click", clicked, false);
  10. }
  11. function clicked()
  12. {
  13. $.ajax({
  14. type: "POST",
  15. url: host+"p1/loginprocess.php",
  16. //data: ({username: un,password:pwd }),
  17. data:$("#frmlogin").serialize(),
  18. cache: false,
  19. dataType: "text",
  20. success: onSuccess
  21. });
  22. }
  23. function onSuccess(data)
  24. {
  25. alert(data);
  26. if(data=="ok")
  27. {
  28. $("#resultLog").html("Validated !");
  29. }
  30. else
  31. {
  32. $("#resultLog").html("Validation Failed, Contact Admin");
  33. }
  34.  
  35. }
Add Comment
Please, Sign In to add comment