上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
摘要: // 1. 导入 fs 文件系统模块 const fs = require('fs') // 2. 调用 fs.writeFile() 方法,写入文件的内容 // 参数1:表示文件的存放路径 // 参数2:表示要写入的内容 // 参数3:回调函数 fs.writeFile('./files/3.tx 阅读全文
posted @ 2022-05-27 14:43 hi123hi159 阅读(58) 评论(0) 推荐(0)
摘要: const fs = require('fs') fs.readFile('./files/11.txt', 'utf8', function(err, dataStr) { if (err) { return console.log('读取文件失败!' + err.message) } conso 阅读全文
posted @ 2022-05-27 14:30 hi123hi159 阅读(89) 评论(0) 推荐(0)
摘要: // 1. 导入 fs 模块,来操作文件 const fs = require('fs') // 2. 调用 fs.readFile() 方法读取文件 // 参数1:读取文件的存放路径 // 参数2:读取文件时候采用的编码格式,一般默认指定 utf8 // 参数3:回调函数,拿到读取失败和成功的结果 阅读全文
posted @ 2022-05-27 14:23 hi123hi159 阅读(514) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> .login-header { width: 100%; text-align: center; height: 30px; 阅读全文
posted @ 2022-05-27 11:36 hi123hi159 阅读(24) 评论(0) 推荐(0)
摘要: // offset 系列 var father = document.querySelector('.father'); var son = document.querySelector('.son'); // 1.可以得到元素的偏移 位置 返回的不带单位的数值 console.log(father 阅读全文
posted @ 2022-05-27 09:42 hi123hi159 阅读(78) 评论(0) 推荐(0)
摘要: //前进一个页面 history.go(1); //后退一个页面 history.go(-1); 阅读全文
posted @ 2022-05-27 09:26 hi123hi159 阅读(86) 评论(0) 推荐(0)
摘要: if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebO 阅读全文
posted @ 2022-05-27 09:15 hi123hi159 阅读(52) 评论(0) 推荐(0)
摘要: console.log(location.search); // ?uname=andy // 1.先去掉? substr('起始的位置',截取几个字符); var params = location.search.substr(1); // uname=andy console.log(param 阅读全文
posted @ 2022-05-27 08:44 hi123hi159 阅读(48) 评论(0) 推荐(0)
摘要: var btn = document.querySelector('button'); var div = document.querySelector('div'); btn.addEventListener('click', function() { // console.log(locatio 阅读全文
posted @ 2022-05-27 08:32 hi123hi159 阅读(142) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv 阅读全文
posted @ 2022-05-26 15:18 hi123hi159 阅读(254) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页