Node.js的客戶端Web框架 kibi
kibi 包括:
- 模板引擎
- URL 路由功能
- JSONP 實現
- 頁面加載指示器
- 支持 pushState
示例代碼:
<html>
<!-- use scripts as you would normally-->
<script src="/jquery.js"></script>
<!-- use the text/plain type to avoid evaluation -->
<script type="text/plain" data-kibi='{
pathname: /^\/$/,
location: "http://mydomain.com/examplejsonp?callback="
}'>
<p>Welcome to my site!</p>
<p>Here is some dynamic content:</p>
<p><% JSON.stringify(this) %></p>
<% kibi.template.footer() %>
</script>
<script type='text/plain' data-kibi='{id: "footer"}'>
<p>This is the footer.</p>
</script>
<script type='text/plain' data-kibi='{pathname: /.*/}'>
<h1>Not found.</h1>
</script>
<!-- load kibi last to make sure it can find everything -->
<script><!-- inlined kibi source code--></script>
</html>
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!