01 2019 档案

摘要:var http = require('http') var fs = require('fs') var template = require('art-template') var path = require('path') var server = http.createServer() v 阅读全文
posted @ 2019-01-20 21:51 lujieting0 阅读(434) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>06-在浏览器中使用art-template</title> </head> <body> <!-- 注意:在浏览器中需要引用 lib/template-web 阅读全文
posted @ 2019-01-20 21:50 lujieting0 阅读(706) 评论(0) 推荐(0)
摘要:// art-template // art-template 不仅可以在浏览器使用,也可以在 node 中使用 // 安装: // npm install art-template // 该命令在哪执行就会把包下载到哪里。默认会下载到 node_modules 目录中 // node_module 阅读全文
posted @ 2019-01-20 21:49 lujieting0 阅读(1299) 评论(0) 推荐(0)
摘要:var http = require('http') var fs = require('fs') var server = http.createServer() var wwwDir = 'D:/Movie/www' server.on('request', function (req, res 阅读全文
posted @ 2019-01-20 21:48 lujieting0 阅读(193) 评论(0) 推荐(0)
摘要:var http = require('http') var fs = require('fs') var server = http.createServer() var wwwDir = 'D:/Movie/www' server.on('request', function (req, res 阅读全文
posted @ 2019-01-20 21:47 lujieting0 阅读(131) 评论(0) 推荐(0)
摘要:var http = require('http') var fs = require('fs') // 1. 创建 Server var server = http.createServer() // 2. 监听 Server 的 request 请求事件,设置请求处理函数 // 请求 // 处理 阅读全文
posted @ 2019-01-20 21:46 lujieting0 阅读(524) 评论(0) 推荐(0)
摘要:// 1. 结合 fs 发送文件中的数据 // 2. Content-Type // http://tool.oschina.net/commons // 不同的资源对应的 Content-Type 是不一样的 // 图片不需要指定编码 // 一般只为字符数据才指定编码 var http = req 阅读全文
posted @ 2019-01-20 20:26 lujieting0 阅读(429) 评论(0) 推荐(0)
摘要:// require // 端口号 var http = require('http') var server = http.createServer() server.on('request', function (req, res) { // 在服务端默认发送的数据,其实是 utf8 编码的内容 阅读全文
posted @ 2019-01-20 20:25 lujieting0 阅读(201) 评论(0) 推荐(0)
摘要:// ip 地址用来定位计算机 // 端口号用来定位具体的应用程序 // 所有需要联网通信的应用程序都会占用一个端口号 var http = require('http') var server = http.createServer() // 2. 监听 request 请求事件,设置请求处理函数 阅读全文
posted @ 2019-01-20 20:23 lujieting0 阅读(1091) 评论(0) 推荐(0)
摘要:// 用来获取机器信息的 操作系统信息模块 var os = require('os') // 用来操作路径的 路径处理模块 var path = require('path') // 获取当前机器的 CPU 信息 console.log(os.cpus()) // memory 内存 consol 阅读全文
posted @ 2019-01-20 20:22 lujieting0 阅读(147) 评论(0) 推荐(0)
摘要:var http = require('http') // 1. 创建 Server var server = http.createServer() // 2. 监听 request 请求事件,设置请求处理函数 server.on('request', function (req, res) { 阅读全文
posted @ 2019-01-20 20:21 lujieting0 阅读(701) 评论(0) 推荐(0)
摘要:var http = require('http') var server = http.createServer() // request 请求事件处理函数,需要接收两个参数: // Request 请求对象 // 请求对象可以用来获取客户端的一些请求信息,例如请求路径 // Response 响 阅读全文
posted @ 2019-01-20 20:20 lujieting0 阅读(191) 评论(0) 推荐(0)
摘要:// 接下来,我们要干一件使用 Node 很有成就感的一件事儿 // 你可以使用 Node 非常轻松的构建一个 Web 服务器 // 在 Node 中专门提供了一个核心模块:http // http 这个模块的职责就是帮你创建编写服务器的 网络服务构建模块 // 1. 加载 http 核心模块 va 阅读全文
posted @ 2019-01-20 20:19 lujieting0 阅读(149) 评论(0) 推荐(0)
摘要:var fs = require('fs') // $.ajax({ // ... // success: function (data) { // } // }) // 第一个参数:文件路径 // 第二个参数:文件内容 // 第三个参数:回调函数 // error // // 成功: // 文件写 阅读全文
posted @ 2019-01-20 20:18 lujieting0 阅读(338) 评论(0) 推荐(0)
摘要:// 浏览器中的 JavaScript 是没有文件操作的能力的 // 但是 Node 中的 JavaScript 具有文件操作的能力 // fs 是 file-system 的简写,就是文件系统的意思 // 在 Node 中如果想要进行文件操作,就必须引入 fs 这个核心模块 // 在 fs 这个核 阅读全文
posted @ 2019-01-20 20:17 lujieting0 阅读(512) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><style> 阅读全文
posted @ 2019-01-19 13:00 lujieting0 阅读(327) 评论(0) 推荐(0)
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>尝试找到一种可以发送不同源请求的方式</title> <!-- link 真正的定义:链入一个文档,通过 rel 属性申明链入的文档与当前文档之间的关系 --> < 阅读全文
posted @ 2019-01-19 13:00 lujieting0 阅读(267) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><body><s 阅读全文
posted @ 2019-01-19 12:59 lujieting0 阅读(222) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><body><s 阅读全文
posted @ 2019-01-19 12:58 lujieting0 阅读(4611) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><body><s 阅读全文
posted @ 2019-01-19 12:57 lujieting0 阅读(582) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><body><s 阅读全文
posted @ 2019-01-19 12:56 lujieting0 阅读(245) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>AJAX 返回数据问题</title></head><b 阅读全文
posted @ 2019-01-19 12:55 lujieting0 阅读(386) 评论(0) 推荐(0)
摘要:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Title</title></head><body><s 阅读全文
posted @ 2019-01-19 11:57 lujieting0 阅读(709) 评论(0) 推荐(0)
摘要:<script> //兼容方案 // var xhr=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP'); var xhr = new XMLHttpRequest(); xhr.open 阅读全文
posted @ 2019-01-19 11:56 lujieting0 阅读(1089) 评论(0) 推荐(0)
摘要:<script> var xhr = new XMLHttpRequest(); xhr.open('GET', 'xml.php'); xhr.send(); xhr.onreadystatechange = function () { if (this.readyState !== 4) ret 阅读全文
posted @ 2019-01-19 11:55 lujieting0 阅读(1101) 评论(0) 推荐(0)
摘要:<script> // console.time('abc') // for (var i = 0; i < 100000000; i++) {} // console.timeEnd('abc') // console.log('begin request') var xhrAsync = new 阅读全文
posted @ 2019-01-19 11:53 lujieting0 阅读(384) 评论(0) 推荐(0)
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>AJAX发送GET请求并传递参数</title></head><body><ul id="list"></ul><script> var listElement = 阅读全文
posted @ 2019-01-19 11:52 lujieting0 阅读(222) 评论(0) 推荐(0)
摘要:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>AJAX发送POST请求</title> <style> #loading { display: none; position: fixed; top: 0; le 阅读全文
posted @ 2019-01-19 11:52 lujieting0 阅读(260) 评论(0) 推荐(0)
摘要:<script> var xhr=new XMLHttpRequest(); xhr.open('POST','/add.http');//设置请求行 xhr.setRequestHeader('Foo','Bar');//设置请求头 //设置的请求体的格式内容(urlencoded),根据请求头 阅读全文
posted @ 2019-01-19 11:51 lujieting0 阅读(327) 评论(0) 推荐(0)
摘要:< !DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body><!--XMLHttpRequest 兼容方案--><!--var xhr=window.XMLHttpReq 阅读全文
posted @ 2019-01-19 11:50 lujieting0 阅读(180) 评论(0) 推荐(0)
摘要:<style> * { margin: 0; padding: 0; } .layout{ width: 500px; height: 600px; border: 1px solid red; margin: 50px auto; /*设置父容器为伸缩盒子*/ display: flex; /*默 阅读全文
posted @ 2019-01-06 22:28 lujieting0 阅读(198) 评论(0) 推荐(0)
摘要:<style> *{ margin: 0; padding: 0; } div{ width: 500px; height: 300px; border: 1px solid red; margin: 100px auto; } div>ul{ list-style: none; width: 10 阅读全文
posted @ 2019-01-06 22:27 lujieting0 阅读(114) 评论(0) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } .box{ width: 900px; height: 600px; border: 1px solid red; margin:0 auto; /*设置父容器为盒子:会使每一个子元素自动变成伸缩项 当子元素的宽度和大于父容器宽 阅读全文
posted @ 2019-01-06 22:26 lujieting0 阅读(626) 评论(0) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } .box{ width: 900px; height: 600px; border: 1px solid red; box-sizing: border-box; margin:0 auto; /*设置父容器为盒子:会使每一个子 阅读全文
posted @ 2019-01-06 22:25 lujieting0 阅读(179) 评论(0) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } .wrapper { width: 100%; padding: 20px; box-sizing: border-box; /*设置多列布局*/ /*1.设置列数*/ column-count: 2; /*2.添加列间隙样式, 阅读全文
posted @ 2019-01-06 22:24 lujieting0 阅读(228) 评论(0) 推荐(0)
摘要:<style> @font-face { font-family: 'iconfont'; src: url('foot/iconfont.eot'); src: url('foot/iconfont.eot?#iefix') format('embedded-opentype'), url('fo 阅读全文
posted @ 2019-01-06 22:23 lujieting0 阅读(256) 评论(0) 推荐(0)
摘要:<style> *{ margin: 0; padding: 0; } .clock{ width: 300px; height: 300px; border: 10px solid #ccc; margin: 100px auto; border-radius: 50%; position: re 阅读全文
posted @ 2019-01-06 22:22 lujieting0 阅读(212) 评论(0) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } div{ width: 100px; height: 100px; background-color: red; /*添加动画效果*/ /*1.animation-name:指定动画名称*/ animation-name: mo 阅读全文
posted @ 2019-01-06 22:21 lujieting0 阅读(406) 评论(1) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } div{ width: 882px; height: 86px; margin:100px auto; background-color: #ddd; overflow: hidden; } div >ul{ width: 20 阅读全文
posted @ 2019-01-06 22:21 lujieting0 阅读(983) 评论(0) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } .box{ width: 200px; height: 200px; margin:100px auto; position: relative; /*让box默认旋转,方便观察*/ transform: rotate3d(1, 阅读全文
posted @ 2019-01-06 22:20 lujieting0 阅读(196) 评论(0) 推荐(0)
摘要:<style> *{ padding: 0; margin: 0; } div{ width: 100px; height: 100px; background-color: red; margin-left: 200px; margin-top:10px; /*添加过渡*/ transition: 阅读全文
posted @ 2019-01-06 22:18 lujieting0 阅读(210) 评论(0) 推荐(0)