2011年10月6日
摘要: 1、js文件编码utf-8无bom编码2、服务端脚本程序入口 (main())http.createServer(function(req, res) { var handler = UrlMap[url.parse(req.url).pathname] || notFound; handler(req, res); }).listen(8080);3、UrlMap,保存请求的路径和对应的处理,通过setUrlMap来设置var UrlMap = {};setUrlMap = function (path, handler) { UrlMap[path] = handler;};4、not.. 阅读全文
posted @ 2011-10-06 22:23 rain.j 阅读(261) 评论(0) 推荐(0) 编辑