Skip to content

Instantly share code, notes, and snippets.

@1uokun
Created June 19, 2019 03:21
Show Gist options
  • Save 1uokun/832b3210dbeb94aca152a73f536ace76 to your computer and use it in GitHub Desktop.
Save 1uokun/832b3210dbeb94aca152a73f536ace76 to your computer and use it in GitHub Desktop.
<script defer async>
console.log(a)
document.addEventListener('DOMContentLoaded', function(event) {
console.log("DOMContentLoaded in serve");
});
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>script defer&async</title>
</head>
<body>
<img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png?asd=123" alt="">
<script src="http://ip/1.js" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function(event) {
console.log("DOMContentLoaded in local");
});
window.addEventListener('load', function(event) {
console.log("load");
});
window.a = '1uokun'
</script>
<code>
log order:
1uokun
DOMContentLoaded in local
DOMContentLoaded in serve
load
</code>
<mark>
that I can use this props in Vue/React
</mark>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment