摘要: <script> let bt = document.querySelector("input"); let mydiv = document.querySelector("div"); let xhr = "null"; // fetch为全局对象的方法,非js库 bt.onclick = fun 阅读全文
posted @ 2021-08-02 22:29 贾正直 阅读(46) 评论(0) 推荐(0)
摘要: <script> let bt = document.querySelector("input"); let mydiv = document.querySelector("div"); let xhr = "null"; bt.onclick = function () { xhr = new X 阅读全文
posted @ 2021-08-02 21:59 贾正直 阅读(82) 评论(0) 推荐(0)
摘要: 请求端 <body> <div> hello world</div> <input type="button" value="ajax"> </body> <style> div { width: 200px; height: 300px; border: aquamarine 1px solid; 阅读全文
posted @ 2021-08-02 20:51 贾正直 阅读(29) 评论(0) 推荐(0)
摘要: let express = require("express"); let app1 = express(); app1.get("/", (r, rs) => { rs.send("收到") }) app1.listen(8000, () => { console.log( "8000服务器启动" 阅读全文
posted @ 2021-08-02 11:33 贾正直 阅读(190) 评论(0) 推荐(0)
摘要: 定义 export default { uname: "li", hello: function () { console.log("hello"); } } 引入 <body> <script type="module"> import * as m from "./app.js" import 阅读全文
posted @ 2021-08-01 20:22 贾正直 阅读(95) 评论(0) 推荐(0)
摘要: 问题 Access to script at 'file:///C:/Users/limakilo0000/OneDrive/limakilo2020.github.io/app.js' from origin 'null' has been blocked by CORS policy: Cros 阅读全文
posted @ 2021-08-01 20:06 贾正直 阅读(112) 评论(0) 推荐(0)
摘要: 基本用法 let p = new Promise(function (resovle, reject) { let data = "yes or not"; // resovle(data); reject(data); //调用then第二个方法 }) p.then(function (value 阅读全文
posted @ 2021-08-01 15:01 贾正直 阅读(30) 评论(0) 推荐(0)
摘要: // 数组遍历方式 let arr = ["a", "b"]; //forEach arr.forEach((a, b) => { console.log(b, ":", a); }) //for of for (const el of arr) { console.log(el, " indexo 阅读全文
posted @ 2021-07-29 23:57 贾正直 阅读(135) 评论(0) 推荐(0)
摘要: jsonp:通过请求script资源 html代码: <body> <div> hello world</div> </body> <style></style> <script> function hello() { document.querySelector("div").style.back 阅读全文
posted @ 2021-07-28 22:25 贾正直 阅读(18) 评论(0) 推荐(0)
摘要: npm配置下载镜像 npm config set registry https://registry.npm.taobao.org npm查询下载镜像 npm config get registry 阅读全文
posted @ 2021-07-28 10:16 贾正直 阅读(25) 评论(0) 推荐(0)