-
Notifications
You must be signed in to change notification settings - Fork 2
/
example3.html
executable file
·50 lines (39 loc) · 1.28 KB
/
example3.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
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="icon" type="image/x-icon" href="../images/favicon.ico" />
<!-- bitwrench.js library examples
(c) M A Chatterjee
deftio <at> deftio <dot> com
web : http:deftio.com/bitwrench
github: http:github.com/deftio/bitwrench
-->
<script type="text/javascript" src="../bitwrench.js"></script>
</head>
<body class="bw-def-page-setup bw-font-sans-serif">
<div id="content"></div>
<script> // this page is written in JSON-HTML.
var jsonContent = [
["h2", {style:"font-style:italic"},"This is the JSON content section"],
"Some content is just a string...<br>",
{c: [["span",{},"inside1 "],"inside string contnt 2","<br>",["p",{"style":"color:red"},"inside red content"]]},
["p",{onclick:function(){alert("I was clicked!")}},"Some content which can be clicked."],
]
// this is the static content at the top of the page.
var html =
{ t: "div",
c:[
["h2",{},"Bitwrench JSON Content demo"],
"<br>",
["p",{},"The JSON below this paragraph represents the page content. The JSON can contain hierachal arrays or objects."],
"<hr>",
bw.htmlJSON(jsonContent),
"<hr>",
bw.html({c:jsonContent})
]
};
bw.DOM("#content",bw.html(html));
</script>
</body>
</html>