1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
3 | |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
6 | <title>Event test</title> |
---|
7 | <script type="text/javascript" src="jquery.lite.js"></script> |
---|
8 | <script type="text/javascript"> |
---|
9 | function handler(e) { |
---|
10 | alert(e.data || 'no data'); |
---|
11 | } |
---|
12 | |
---|
13 | $(function() { |
---|
14 | $('#a2').bind('click', handler); |
---|
15 | }); |
---|
16 | </script> |
---|
17 | </head> |
---|
18 | |
---|
19 | <body> |
---|
20 | <a href="#" id="a2">Click 2</a> |
---|
21 | </body> |
---|
22 | |
---|
23 | </html> |
---|