js script all in one
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 发布文章使用:只允许注册用户才可以访问!
js script all in one的更多相关文章
- js script中引用其他script
在需要引用目标js中引用其他js依赖项 可以使用这个方法直接在js顶部加入这一行即可 document.write("<script type='text/javascript' sr ...
- <script src="../build/browser.min.js"></script> 是用来里面babel工具把ES6的语法转成ES5
<!DOCTYPE html> <html> <head> <script src="../build/react.js">< ...
- window.jQuery || document.write("<script src='__PUBLIC__/assets/js/jquery.js'>"+"<"+"/script>")
今天无意中看到这样一段代码 <script type="text/javascript"> window.jQuery || document.write(" ...
- js script type 部分属性值分析
1. text/javascript: (1)<script type="text/javascript" src="Js/jquery-1.10.2.min.js ...
- <!--[if IE]><script type="text/javascript" src="matrix/js/html5.js"></script><![endif]-->代码解释
块注释例子 1. <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->2. <!--[if IE]> 所有的I ...
- Js script type="text/template"的使用简单说明
<script type="text/template" id="treeTableTpl"> <tr id="{{row.id}} ...
- js——<script>标签的加载顺序
用了很久的JavaScript,今天突然就碰见了将一个js文件放在<head></head>与<body></body>标签中,一个不可以执行,一个可以 ...
- js script放在head和body里面的区别
详见: http://blog.yemou.net/article/query/info/tytfjhfascvhzxcytp66 java script放在head和body的区别 ...
- JS文件加载:比较async和DOM Script
async与script动态加载都能使文件异步加载,本文叙述它们对页面渲染和load加载的影响方面. 目前我用demo.js作为执行文件操作.代码: var now = function() { re ...
随机推荐
- dict 切片 间隔取值
1. 字典型d[k].d.get(k),如果键名不存在 报错.返回None 2. 可以为键设置不存在情况的下的覆盖None的返回值 3. 字符串str可以看成是list 4. 对字符串的截取通过切片实 ...
- Fody,告别烦人的INotifyPropertyChanged,最简方式实现通知!
INotifyPropertyChanged 我不是针对谁,我是说在座的各位 相信所有学wpf的,都写过类似下面的代码: 实现INotifyPropertyChanged public class M ...
- 十六:SpringBoot-自定义启动页,项目打包和指定运行环境
SpringBoot-自定义启动页,项目打包和指定运行环境 1.自定义启动页 2.打包配置 2.1 打包pom配置 2.2 多环境配置 3.环境测试接口 4.打包执行 4.1 指定模块打包 4.2 运 ...
- java架构《并发线程高级篇三》
本章主要介绍和讲解concurrent.util里面的常用的工具类. 一.CountDownLatch使用:(用于阻塞主线程) 应用场景 :通知线程休眠和运行的工具类,是wait和notify的升级版 ...
- 静态代理和jdk动态代理
要说动态代理,必须先聊聊静态代理. 静态代理 假设现在项目经理有一个需求:在项目现有所有类的方法前后打印日志. 你如何在不修改已有代码的前提下,完成这个需求? 我首先想到的是静态代理.具体做法是: 1 ...
- linux 一分钟搭建zookeeper linux 单机版(亲测可用)
wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gzt ...
- 一篇文章图文并茂地带你轻松学完 JavaScript 事件循环机制(event loop)
JavaScript 事件循环机制 (event loop) 本篇文章已经默认你有了基础的 ES6 和 javascript语法 知识. 本篇文章比较细致,如果已经对同步异步,单线程等概念比较熟悉的读 ...
- 【BFS】hdu 1973 Prime Path
题目描述: http://poj.org/problem?id=3414 中文大意: 使用两个锅,盛取定量水. 两个锅的容量和目标水量由用户输入. 允许的操作有:灌满锅.倒光锅内的水.一个锅中的水倒入 ...
- 小白的经典CNN复现(三):AlexNet
小白的经典CNN复现(三):AlexNet 锵锵--本系列的第三弹AlexNet终于是来啦(≧∀≦),到了这里,我们的CNN的结构就基本上和现在我们经常使用或者接触的一些基本结构差不多了,并且从这一个 ...
- AtCoder Beginner Contest 183
第二次ak,纪念一下. 比赛链接:https://atcoder.jp/contests/abc183/tasks A - ReLU 题解 模拟. 代码 #include <bits/stdc+ ...