摘要: /** * json 转换的两种方式 * * 一,转为字符串 (序列化的过程) * JSON.stringify() * * 二,json 转化为字符串 (反序列化的过程) * JSON.parse() * */ var arr = ['爱奇艺','腾讯','优酷']; var obj = {nam 阅读全文
posted @ 2019-05-27 20:08 武卡卡 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 思想 : 前台主动发起获取 =》 ajax 1,前台文件 index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-wid 阅读全文
posted @ 2019-05-27 19:40 武卡卡 阅读(320) 评论(0) 推荐(0) 编辑
摘要: const fs = require('fs'); fs.readdir('./','utf8',(err,data)=>{ console.log(data) }) 阅读全文
posted @ 2019-05-27 18:14 武卡卡 阅读(1204) 评论(0) 推荐(1) 编辑
摘要: fs.readFile('.'+urls, function (err, data) { res.end(data) }); 阅读全文
posted @ 2019-05-27 10:39 武卡卡 阅读(177) 评论(0) 推荐(0) 编辑
摘要: const http = require('http'); const fs = require('fs'); const server = http.createServer(); server.on('request', function (req, res) { // 根据每次请求的文件类型给 阅读全文
posted @ 2019-05-27 10:26 武卡卡 阅读(359) 评论(0) 推荐(0) 编辑