Created
April 5, 2013 15:07
-
-
Save nurularifins/5320021 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Door Lock - Login</title> | |
| <link rel="stylesheet" href="style.css" type="text/css" /> | |
| <script type="text/javascript" charset="utf-8" src="cordova.js"></script> | |
| <script type="text/javascript" charset="utf-8" src="jquery.min.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| // Wait for Cordova to load | |
| // | |
| document.addEventListener("deviceready", onDeviceReady, false); | |
| // Cordova is ready | |
| // | |
| function onDeviceReady() { | |
| // Empty | |
| } | |
| // alert dialog dismissed | |
| function alertDismissed() { | |
| // do something | |
| } | |
| // Show a custom alertDismissed | |
| // | |
| function Login() { | |
| var username = document.getElementById("username").value; | |
| var password = document.getElementById("password").value; | |
| $.ajax({ | |
| url: 'http://mysubdomain.mydomain.com/index.php', | |
| data: {}, | |
| dataType: 'application/json', | |
| error: function(error) { | |
| alert(error); | |
| }, | |
| success: function(data) { | |
| alert('In callback'); | |
| } | |
| }); | |
| } | |
| </script> | |
| </head> | |
| <body> | |
| <div id="main"> | |
| <table align="center" border="0" width="98%"> | |
| <tr> | |
| <td><input type="text" name="username" placeholder="Username" id="username" required></td> | |
| </tr> | |
| <tr> | |
| <td><input type="password" name="password" placeholder="Password" id="password" required></td> | |
| </tr> | |
| <tr> | |
| <td><input type="button" value="Login" class="button" id="btnSubmit" onClick="Login()"></td> | |
| </tr> | |
| </table> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment