-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.html
More file actions
45 lines (42 loc) · 1005 Bytes
/
example.html
File metadata and controls
45 lines (42 loc) · 1005 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<html>
<head>
<title>Inspect</title>
<script src="build/build.js"></script>
<style>
body {
padding: 80px;
font: 16px/1.6 Helvetica;
}
p {
width: 600px;
}
code {
color: #888;
}
</style>
</head>
<body>
<h1>Inspect</h1>
<p>Open web inspector, enable via <code>localStorage.dev = true</code>, refresh the page, view <code>_</code> in the "properties" panel or with <code>$0._</code>.</p>
<ul></ul>
<script>
var dev = require('dev');
var ul = document.querySelector('ul');
function UserView(user) {
this.user = user;
this.el = document.createElement('li');
this.el.textContent = user.name;
dev(this.el, user);
}
var users = [
{ name: 'Tobi', species: 'ferret' },
{ name: 'Loki', species: 'ferret' },
{ name: 'Jane', species: 'ferret' }
];
users.forEach(function(user){
var view = new UserView(user);
ul.appendChild(view.el);
});
</script>
</body>
</html>