This repository was archived by the owner on Mar 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathbasic_example.html
More file actions
80 lines (65 loc) · 2.55 KB
/
basic_example.html
File metadata and controls
80 lines (65 loc) · 2.55 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" manifest="cache-manifest">
<!--
http://unlicense.org/
author: gregory tomlinson
-->
<!-- MIME TYPE Guidlines and references: http://hixie.ch/advocacy/xhtml -->
<head>
<title>fastFrag Sample Basic</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="awesome" />
<meta name="description" content="" />
</head>
<body>
<div id="container">
<div id="top">
<h1>A Simple Example of fastFrag.js</h1>
<p>Create a nested div, p, and a link to the fastFrag Repo</p>
</div> <!-- end #top -->
<div id="middle">
</div> <!-- END #middle -->
<div id="bottom">
<pre>
// sample code
var structure = {
css : "my_div_classname",
content : {
type : "p",
id : "an_html_id",
content : {
type : 'a',
attributes : {
href : 'http://github.com/gregory80/fastFrag'
},
content : "fastFrag Repo"
}
}
}
var fast_doc_frag = fastFrag.create( structure ); // transform from JSON to Dom Fragment
document.getElementById('middle').appendChild( fast_doc_frag );
</pre>
</div> <!-- end #bottom -->
</div> <!-- end #container -->
<script type="text/javascript" src="js/fastFrag.js"></script>
<script type="text/javascript" charset="utf-8">
// the actual fastFrag structure, as rendered via JS
var structure = {
css : "my_div_classname",
content : {
type : "p",
id : "an_html_id",
content : {
type : 'a',
attr : {
href : 'http://github.com/gregory80/fastFrag'
},
content : "fastFrag Repo"
}
}
}
var fast_doc_frag = fastFrag.create( structure ); // transform from JSON to Dom Fragment
document.getElementById('middle').appendChild( fast_doc_frag ); // append
</script>
</body>
</html>