Bug Tracker

Ticket #935: test_935.htm

File test_935.htm, 862 bytes (added by arrix, 16 years ago)

unable to unbind() if data is specified for bind()

Line 
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">
9function handler(e) {
10        alert(e.data || 'no data');
11}
12
13function remove() {
14        $('#a1').unbind('click', handler);
15        $('#a2').unbind('click', handler);
16}
17$(function() {
18        $('#a1')
19        .bind('click', 'haha', handler)
20        .bind('click', 'hoho', handler);
21       
22        $('#a2')
23        .bind('click', handler)
24        .bind('click', handler);
25});
26</script>
27</head>
28
29<body>
30<a href="#" id="a1">With data</a>
31<a href="#" id="a2">Without data</a>
32<a href="#" onclick="remove()">Unbind</a>
33</body>
34
35</html>