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

https://hacks.mozilla.org/2017/09/building-the-dom-faster-speculative-parsing-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 发布文章使用:只允许注册用户才可以访问!


最新文章

  1. UVA10325 The Lottery(容斥原理)
  2. FlexiGrid 使用 全选、自动绑定
  3. Request三种获取数据的方式
  4. Ubuntu 14.04 软件源服务器列表
  5. OpenJudge计算概论-最长平台
  6. java 产生随机数的方法
  7. Ubuntu安装google Gtest
  8. JAVA练习
  9. ie6兼容性,还需要测试么?迷茫。。。
  10. 设置角色遗留问题和为权限设置角色以及EasyUI Tabs的使用
  11. 转 Apache Ant 实现自动化部署
  12. Rigidbody组件及相关API
  13. 在JavaScript中使用三目运算符时进行多个操作
  14. 解决spring 用@Value注入配置时候出现中文乱码问题
  15. lucene和solr的区别(六)
  16. h5 中软键盘弹出后,点击退出键盘,页面无法恢复
  17. 近几年杭电OJ大型比赛题目合集【更新到2017年11月初】
  18. 【Go命令教程】13. go tool cgo
  19. WampServer在win10系统下安装的坑
  20. c++ 开放随笔

热门文章

  1. 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
  2. 服务器端IO模型的简单介绍及实现 阻塞 / 非阻塞 VS 同步 / 异步 内核实现的拷贝效率
  3. Tensorflow-各种优化器总结与比较
  4. JPEG解码——(3)文件头解析
  5. EF Code First 无法加载指定的元数据资源
  6. react+ant design 项目执行yarn run eject 命令后无法启动项目
  7. JDBC连接Oracle实现增、删、改操作
  8. Object类的常见方法总结
  9. springboot中的parent依赖作用详解
  10. Jenkins开启丢弃旧的构建?你可要小心啊!