forked from chuanxshi/javascript-patterns
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdata.html
More file actions
25 lines (20 loc) · 393 Bytes
/
data.html
File metadata and controls
25 lines (20 loc) · 393 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!doctype html>
<html lang="en">
<head>
<title>JavaScript Patterns</title>
<meta charset="utf-8">
</head>
<body>
<script>
/* Title: data
* Description: pattern and antipattern of using data
*/
// antipattern
$(elem).data(key, value);
// preferred
$.data(elem, key, value);
// References
// http://paulirish.com/2009/perf/
</script>
</body>
</html>