js script all in one
2024-08-31 22:41:24
js script all in one
你不知道的 js secret
https://html.spec.whatwg.org/multipage/scripting.html
https://html.spec.whatwg.org/multipage/scripting.html#attr-script-async
https://html.spec.whatwg.org/multipage/scripting.html#attr-script-defer
defer vs async
https://developer.mozilla.org/en-US/docs/Web/API/HTMLScriptElement
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
module
.mjs
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
<script type="module">
import {addTextToBody} from './utils.mjs';
addTextToBody('Modules are pretty cool.');
</script>
// utils.mjs
export function addTextToBody(text) {
const div = document.createElement('div');
div.textContent = text;
document.body.appendChild(div);
}
<script src="./libs/json5.min.js"></script>
<script type="module">
// const JSON5 = require('json5');
import * as JSON5 from "./libs/json5.min.js";
// JSON5.stringify(value[, replacer[, space]]);
// JSON5.stringify(value[, options]);
</script>
https://github.com/json5/json5/issues/187
type
refs
https://dev-preview.cnblogs.com/xgqfrms/p/12371162.html
async, defer and preload
prefetch & preload & prerender
https://www.cnblogs.com/xgqfrms/p/8984852.html
dns-prefetch
https://developer.mozilla.org/en-US/docs/Web/Performance/dns-prefetch
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
最新文章
- UVA10325 The Lottery(容斥原理)
- FlexiGrid 使用 全选、自动绑定
- Request三种获取数据的方式
- Ubuntu 14.04 软件源服务器列表
- OpenJudge计算概论-最长平台
- java 产生随机数的方法
- Ubuntu安装google Gtest
- JAVA练习
- ie6兼容性,还需要测试么?迷茫。。。
- 设置角色遗留问题和为权限设置角色以及EasyUI Tabs的使用
- 转 Apache Ant 实现自动化部署
- Rigidbody组件及相关API
- 在JavaScript中使用三目运算符时进行多个操作
- 解决spring 用@Value注入配置时候出现中文乱码问题
- lucene和solr的区别(六)
- h5 中软键盘弹出后,点击退出键盘,页面无法恢复
- 近几年杭电OJ大型比赛题目合集【更新到2017年11月初】
- 【Go命令教程】13. go tool cgo
- WampServer在win10系统下安装的坑
- c++ 开放随笔
热门文章
- You shouldn&#39;t use *any* general-purpose hash function for user passwords, not BLAKE2, and not MD5, SHA-1, SHA-256, or SHA-3
- 服务器端IO模型的简单介绍及实现 阻塞 / 非阻塞 VS 同步 / 异步 内核实现的拷贝效率
- Tensorflow-各种优化器总结与比较
- JPEG解码——(3)文件头解析
- EF Code First 无法加载指定的元数据资源
- react+ant design 项目执行yarn run eject 命令后无法启动项目
- JDBC连接Oracle实现增、删、改操作
- Object类的常见方法总结
- springboot中的parent依赖作用详解
- Jenkins开启丢弃旧的构建?你可要小心啊!