2014年1月17日 星期五

Advanced JS Chapter 1

記事本編輯器:
http://qqboxy.blogspot.com/2010/06/emeditor-6004.html

Node.js官方網站:
http://nodejs.org/

Node.js架設教學:
http://qqboxy.blogspot.com/2013/07/portable-nodejsnpmexpress-windows.html

Express官方網站:
http://expressjs.com/

w3school教學網站:
http://www.w3schools.com/

main.js:
var express = require("./node_modules/express");
var app = express();
var port = 1337;
app.listen(port);

app.use('/', express.static(__dirname + '/'));

app.get('/', function(req, res) {
    res.send("Hello World!!");
});

console.log("Start express server");

index.html
<!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" lang="zh-TW" xml:lang="zh-TW"><!--標籤--><!--屬性-->
<head><!--元素-->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Title</title>
</head>
<body>
<script type="text/javascript"></script>
<h1>My First Page.</h1>
</body>
</html>

學習步驟:
1. 首先了解如何配置一個Node.js伺服器。
2. 在伺服器執行一個js腳本。
3. 學習簡單的html架構。
4. 了解如何在伺服器上連結html檔案。
5. 看w3school網站HTML語法教學。

作業1:
1. 設計一個自我介紹的網站,具備多個分頁標籤,能夠超連結進入各個頁面。

沒有留言:

張貼留言