-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.html
39 lines (39 loc) · 1.25 KB
/
test.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
39
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery UA Plugin</title>
<style>
tr:nth-child(odd) { background-color: #f0f0f0; }
th, td { line-height: 1.5em; padding: 0 0.5em; text-align: left; vertical-align: baseline; }
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="./jquery.ua.js"></script>
<script type="text/javascript">
$(function () {
var html = [],
i,
j;
html[html.length] = '<h2><code>navigator.userAgent</code></h2>';
html[html.length] = '<p><code>' + navigator.userAgent + '</code></p>';
html[html.length] = '<h2><code>$.ua</code></h2>';
html[html.length] = '<table><tbody>';
for (i in $.ua) {
if (i === 'data' || i === 'init') {
continue;
}
for (j in $.ua[i]) {
html[html.length] = '<tr><th><code>$.ua.' + i + '.' + j + '</code></th><td><code>' + $.ua[i][j] + '</code></td></tr>';
}
}
html[html.length] = '</tbody></table>';
html[html.length] = '<h2>Classes added to the <code>html</code> element</h2>';
html[html.length] = '<p><code>' + $('html')[0].className + '</code></p>';
$('#test').html(html.join(''));
});
</script>
</head>
<body>
<div id="test"></div>
</body>
</html>