-
Notifications
You must be signed in to change notification settings - Fork 115
/
index.ejs
29 lines (29 loc) · 1.02 KB
/
index.ejs
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
<!DOCTYPE html5>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Hello!</title>
<!-- General META -->
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
</head>
<body>
<h2>Hello!</h2>
<button id="test">Show Article Previews</button>
<a href="/articles/all">Show all articles</a>
<div id="list"></div>
</body>
<script src="lib/jquery/dist/jquery.min.js"></script>
<script src="vendor/ejs_production.js"></script>
<script>
$("#test").click(function(){
$.get("/api/articles", function(data, status){
var html = new EJS({url: 'views/article/list.ejs'}).render({articles:data});
$("#list").html(html);
});
});
</script>
</html>