11 2021 档案
摘要:1.在终端启动app.js 2.创建模块的字段 //导入mongoose const mongoose = require("mongoose"); //建立数据库连接 mongoose.connect("mongodb://127.0.0.1:27017/test"); const tagSche
阅读全文
摘要:在Visual Studio Code上的操作 1.创建一个node_modules的文件夹2.在node_modules中创建一个content.router.js,tag.router.js,user.router.js的js文件(模块) 创建模块 终端: nodemon app.js 启动ap
阅读全文
摘要:终端: 1.安装koa-router npm i koa-router --save //i指install 2. 用 nodemon 来代替 node 来启动应用 nodemon app.js 效果如下: app.js的代码的步骤 //引入类 //引入内部方法或属性 //const{方法或属性名}
阅读全文
摘要:koa 基于Node.js平台的下一代web开发框架(洋葱模型 一层一层往外) 1.app.js中的代码 //引入类 const Koa = require('koa'); //引入内部方法或属性 //const{方法或属性名}=request('koa); //创建对象 const app = n
阅读全文
摘要:### 项目初始化 (需要什么就写什么 不是每次都要初始化的) `npm init` `自定义初始化` `npm init -y` `默认生成` 一般使用 -y 的时候比较多 ### 安装项目依赖(包) `npm install` `npm install 包名 --save` `当前项目可用` `
阅读全文
摘要:1.第三种请求json文件的方法 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
阅读全文
摘要:1.data.json的数据 { "status":200, "data":{ "name":"web211001", "student":[ {"id":10001,"name":"张三"}, {"id":10002,"name":"李四"}, {"id":10003,"name":"王五"} ]
阅读全文
摘要:1. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> /* 所有图片横向布局 10' 图片之间的间隔为16px 10' 第一张图片的左边距为0 10' 最后一张图
阅读全文
摘要:<script> //typeof instanceof var arr=[1,2,3,4,5]; // console.log(typeof arr); //object // console.log(typeof {}); //object // console.log(arr instance
阅读全文
摘要:1.对象 <script> function Car(name,speed){ this.name=name; this.speed=speed; } Car.prototype.showName=function(){ //独立出来的公共空间,减少内存 console.log(this.name)
阅读全文
摘要:1.登录页面悬在其他页面上 $(function(){ $("#loginPopup").click(function(){//登录按钮的点击事件 $(".pop-bg,.pop-wrapper").show(); //让遮罩层和窗口显示 $("body").css("overflow", "hid
阅读全文
摘要:1.轮播图 <!-- 首先要把jQuery的文件链接进来 --> <script src="./js/jquery-3.3.1.min.js"></script> <!-- 链接index页面的js --> <script src="js/index.js"></script> jQuery部分:$
阅读全文
摘要:<style> div{ width: 200px; height: 200px; background-color: rgb(65, 135, 226); } </style> 先输出一个div正方形 1.行内样式 改变display的值 隐藏 display:none 显示 display:原始
阅读全文
摘要:先引入jQuery文件,入口函数: <script> $(function(){ }); </script> 1.内部插入 => 子节点 append(content|fn) 向每个匹配的元素内部追加内容。 append和appendTo效果一样 prepend(content) 向每个匹配的元素内
阅读全文
摘要:1.坐标的基准 screen 屏幕 显示器左上角 page 页面 当前页面左上角 client 可视区域 显示页面的区域的左上角 offset 元素 元素的左上角 页面没有滚动时,page与client基准点重合 2.基本事件 click事件 $(".child").click(function()
阅读全文
摘要:1.attr 和prop attr 设置或返回被选元素的属性值 attr(属性名) 获取属性 attr(属性名,属性值) 设置属性 $("span").attr("data-id","1002");//data-id="1001" console.log($("span").attr("id"));
阅读全文
摘要:1.jQuery是什么? jQuery 是一个 JavaScript 库。 jQuery 极大地简化了 JavaScript 编程。 jQuery 是一个轻量级的"写的少,做的多"的 JavaScript 库。 2.jQuery 入口函数: 第一种$(document).ready(function
阅读全文
摘要:鼠标动画案列1 让span标签里面的文字随着鼠标的移动而移动 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <meta name="viewport" content="width=device-wi
阅读全文
摘要:Document 对象 常用的四种方法 document.getElementById(); 返回对拥有指定 id 的第一个对象的引用。 document.getElementsByClassName(); 返回文档中所有指定类名的元素集合。 document.getElementsByName;
阅读全文
摘要:1.创建对象的第一种方式 2.创建对象的第二种方式 3.创建对象的第三种方式 4.方法里的链式编程 function Student(id,name){ this.id=id; this.name=name; this.eat=function(food){ console.log("吃"+food
阅读全文
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
摘要:justify-content 语法 justify-content: flex-start | flex-end | center | space-between | space-around flex-start:弹性盒子元素将向行起始位置对齐。flex-end:弹性盒子元素将向行结束位置对齐。
阅读全文

浙公网安备 33010602011771号