-
Notifications
You must be signed in to change notification settings - Fork 3
/
modernizr.html
38 lines (28 loc) · 928 Bytes
/
modernizr.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hashable jQuery Test : Event with Modernizr</title>
</head>
<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
<script type="text/javascript" src="jquery.hashable.js"></script>
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$(window).bind("hashChange", function(e, newHash, oldHash) {
console.log("new: " + newHash);
console.log("old: " + oldHash);
});
$(window).hashChange();
});
})(jQuery);
function randomHash() {
window.location.hash = "#" + Math.floor(Math.random() * 9999);
return false;
}
</script>
<a href="#" onclick="return randomHash();">Change Hash</a>
</body>
</html>