Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 39 lines (33 sloc) 1.019 kb
8a2e897 @nakajima EVENTZ. At least a little bit.
authored
1 <html>
2 <head>
3 <style type="text/css" media="screen">
4 li { color: #aaa; }
5 </style>
6 <script src="/base.js" type="text/javascript" charset="utf-8"></script>
7 <script src="/events.js" type="text/javascript" charset="utf-8"></script>
8 </head>
9 <body>
10 <h1>The Events Page</h1>
11 <p>
12 <a href="#clicked" id="clickable">Click Me</a>
13 </p>
14
4310712 @nakajima Event delegations and optimizations
authored
15 <ul>
16 <li><a href="#delegated" class="delegated-click">Delegated</a></li>
17 <li><a href="#" class="not-delegated">Not Delegated</a></li>
18 </ul>
8a2e897 @nakajima EVENTZ. At least a little bit.
authored
19
4310712 @nakajima Event delegations and optimizations
authored
20 <label for="text">text</label><input name="text" value="" id="text">
8a2e897 @nakajima EVENTZ. At least a little bit.
authored
21
22 <script type="text/javascript" charset="utf-8">
4310712 @nakajima Event delegations and optimizations
authored
23 $('#clickable').live('click', function(e) {
8a2e897 @nakajima EVENTZ. At least a little bit.
authored
24 alert(this.html());
25 return false;
26 });
27
4310712 @nakajima Event delegations and optimizations
authored
28 $('.delegated-click').live('click', function() {
29 alert('Delegated!');
30 return false;
31 });
32
33 $('#text').on('keyup', function(e) {
8a2e897 @nakajima EVENTZ. At least a little bit.
authored
34 console.info('changed: ' + this.val());
35 });
36 </script>
37 </body>
38 </html>
Something went wrong with that request. Please try again.