-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playing around with defer and sync WP strategies
- Loading branch information
1 parent
38cf0a1
commit 0f44f51
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(() => { | ||
console.log('defer-sync-elements loaded.'); | ||
const elements = ['default', 'defer', 'async']; | ||
|
||
for (const element of elements) { | ||
let el = document.createElement('h3'); | ||
el.className = element; | ||
el.innerHTML = `${element} element`; | ||
document.querySelector('.page-header-title').insertAdjacentElement("afterend", el); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(() => { | ||
console.log('defer-sync-script loaded.'); | ||
for (const element of [['default', 'orange'], ['defer', 'purple'], ['async', 'green']]) { | ||
document.querySelector(`.${element[0]}`).style.color = element[1]; | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters