Advertisement
Guest User

Untitled

a guest
Dec 30th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  1. <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' data: blob: filesystem: ws: gap: file: cdvfile: https://ssl.gstatic.com *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; child-src *; ">
  2.  
  3. <allow-navigation href="*" />
  4. <allow-intent href="*" />
  5. <access origin="*"/>
  6.  
  7. <html>
  8. <head>
  9. <script type="text/javascript" src="cordova.js"></script>
  10. <script type="text/javascript" src="scripts/scripts.js"></script>
  11. <meta charset="utf-8" />
  12. <meta name="format-detection" content="telephone=no" />
  13. <meta name="msapplication-tap-highlight" content="no" />
  14. <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
  15. <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' data: blob: filesystem: ws: gap: file: cdvfile: https://ssl.gstatic.com *; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'; img-src * data: 'unsafe-inline'; connect-src * 'unsafe-inline'; child-src *; ">
  16. <link rel="stylesheet" type="text/css" href="style/bootstrap.min.css">
  17. <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
  18. <link rel="stylesheet" type="text/css" href="style/leaf.css">
  19. <title>App Name</title>
  20. </head>
  21. <body onload="onLoad()">
  22.  
  23.  
  24. <img style="width:25%; padding-top:2em;" src="img/logo.png" /> <!-- Local image, which works fine on all devices -->
  25. <img style="width:25%; padding-top:2em;" src="http://www.userlogos.org/files/logos/Karmody/alaTest_Iphone01a.png" /> <!-- external image which didn't work earlier but works now since I changed the header permissions -->
  26. <form id="loginForm" onsubmit='return false;' action="http://LINK TO SERVER/login.php" role="form" method="post" >
  27.  
  28. <input type="text" name="username" id="username">
  29.  
  30.  
  31. <input type="password" name="password" id="password">
  32.  
  33.  
  34. <input type="submit" name="submit" value="Login">
  35.  
  36. </form>
  37.  
  38. <h3><a href='http://google.com'>Link to page (Works in browser but not in mobile)</a></h3>
  39.  
  40.  
  41. </body>
  42. </html>
  43.  
  44. function onLoad() {
  45. document.addEventListener("deviceready", onDeviceReady, false);
  46. }
  47. function onDeviceReady() {
  48. console.log(device.uuid);
  49. }
  50.  
  51. function onDeviceReady() {
  52. $('#loginForm').submit(function(){
  53. var username = $("[name='username']").val();
  54. var password = $("[name='password']").val();
  55. var dataString = {username: username,password: password};
  56. $.ajax({
  57. type: "POST",
  58. url: "http://LINK TO SERVER/login.php",
  59. data: dataString,
  60. dataType: 'json',
  61. crossDomain: true,
  62. cache: false,
  63. success: function(responseBack){
  64. if(response == "success"){alert("Successfully authenticated.");}
  65. else{alert("Username/password incorrect.");}
  66. }
  67. });
  68.  
  69.  
  70. });
  71.  
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement