Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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 *; ">
- <allow-navigation href="*" />
- <allow-intent href="*" />
- <access origin="*"/>
- <html>
- <head>
- <script type="text/javascript" src="cordova.js"></script>
- <script type="text/javascript" src="scripts/scripts.js"></script>
- <meta charset="utf-8" />
- <meta name="format-detection" content="telephone=no" />
- <meta name="msapplication-tap-highlight" content="no" />
- <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
- <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 *; ">
- <link rel="stylesheet" type="text/css" href="style/bootstrap.min.css">
- <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
- <link rel="stylesheet" type="text/css" href="style/leaf.css">
- <title>App Name</title>
- </head>
- <body onload="onLoad()">
- <img style="width:25%; padding-top:2em;" src="img/logo.png" /> <!-- Local image, which works fine on all devices -->
- <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 -->
- <form id="loginForm" onsubmit='return false;' action="http://LINK TO SERVER/login.php" role="form" method="post" >
- <input type="text" name="username" id="username">
- <input type="password" name="password" id="password">
- <input type="submit" name="submit" value="Login">
- </form>
- <h3><a href='http://google.com'>Link to page (Works in browser but not in mobile)</a></h3>
- </body>
- </html>
- function onLoad() {
- document.addEventListener("deviceready", onDeviceReady, false);
- }
- function onDeviceReady() {
- console.log(device.uuid);
- }
- function onDeviceReady() {
- $('#loginForm').submit(function(){
- var username = $("[name='username']").val();
- var password = $("[name='password']").val();
- var dataString = {username: username,password: password};
- $.ajax({
- type: "POST",
- url: "http://LINK TO SERVER/login.php",
- data: dataString,
- dataType: 'json',
- crossDomain: true,
- cache: false,
- success: function(responseBack){
- if(response == "success"){alert("Successfully authenticated.");}
- else{alert("Username/password incorrect.");}
- }
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement