Skip to content

Instantly share code, notes, and snippets.

@gihrig
Created May 28, 2015 05:23
Show Gist options
  • Save gihrig/012a4505ff2dc679ee6a to your computer and use it in GitHub Desktop.
Save gihrig/012a4505ff2dc679ee6a to your computer and use it in GitHub Desktop.
Bhavr Delgtn html Ex3
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h3>Simpler Design</h3>
<p><b>"Nicer Syntax" Login/Auth code implemented using OLOO-style Behavior Delegation:</b></p>
<p><small>YDKJS ch 6: Login/AuthController from proto-9-Simpler-Design.js</small></p>
<p><small>User: Joe Password: Password</small></p>
<br/>
<form id="login_form" action="" method="GET">
<label for="login_username">User Name</label>
<input id="login_username" type="text" value=""/>
<label for="login_password">Password</label>
<input id="login_password" type="text" value=""/>
<input type="submit" name="Login"/>
</form>
<script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="proto-10~Nicer-Syntax-code.js"></script>
<script>
$('#login_form').submit(function (e) {
AuthController.checkAuth();
e.preventDefault();
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment