-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
46 lines (38 loc) · 1.48 KB
/
example.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
<!-- Max Base -->
<!-- https://github.com/BaseMax/ko-engine -->
<script type="text/javascript" src="https://basemax.github.io/ko-engine/source/ko-engine.js"></script>
<!-- Load from local files: <script type="text/javascript" src="../source/ko-engine.js"></script> -->
<div id="app"></div><br>
<div id="test1"></div><br>
Your IP: <div id="test2">... (loading)</div><br>
<div id="test5"></div><br>
<div id="test6"></div><br>
<br><hr><p>Access to library source code at GitHub: <a href="https://github.com/BaseMax/ko-engine">https://github.com/BaseMax/ko-engine</a></p>
<script type="text/javascript">
// #app
KoEngine("Hello, I'm <?name?> and It's my GitHub profile: <?github?>.", {
name: "Max",
github: "<a href='https://github.com/basemax'>@BaseMax</a>"
}, '#app');
// #test1
KoEngine("Hello, It's a plain text!", '#test1');
// #test2
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200) {
KoEngine(this.responseText, '#test2');
}
};
request.open("GET", "https://api.ipify.org/", true);
request.send();
// #test3
console.log( KoEngine("Hello, It's a plain text!") );
// #test4
console.log( KoEngine("Hello, I'm <?name?> and It's my GitHub profile: <?github?>.", {
name: "Max",
github: "<a href='https://github.com/basemax'>@BaseMax</a>"
}) );
// #test5
KoEngine("<?if(2>5){?> It's a plain text!<?} else{?>Ha ha<?}?>", '#test5');
KoEngine("<?if(5>2){?> It's a plain text!<?}?>", '#test6');
</script>