-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathnamespacing_object_lit_notation.html
More file actions
48 lines (44 loc) · 1.32 KB
/
Copy pathnamespacing_object_lit_notation.html
File metadata and controls
48 lines (44 loc) · 1.32 KB
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
46
47
48
<!DOCTYPE html>
<html>
<head>
<title>Deeply Nested Object Literal Notation Example</title>
<script>
const myApplication = {
getInfo() {
console.log('Application Information');
},
models: {
user: {
login() {
console.log('User Logged In');
},
logout() {
console.log('User Logged Out');
}
}
},
views: {
pages: {
home: {
show() {
console.log('Home Page Shown');
}
},
about: {
show() {
console.log('About Page Shown');
}
}
}
},
collections: {}
};
</script>
</head>
<body>
<button onclick="myApplication.views.pages.home.show()">Show Home Page</button>
<button onclick="myApplication.views.pages.about.show()">Show About Page</button>
<button onclick="myApplication.models.user.login()">Login</button>
<button onclick="myApplication.models.user.logout()">Logout</button>
</body>
</html>