File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -118,14 +118,16 @@ function setupStickyHeaders() {
118
118
) . observe ( header ) ;
119
119
}
120
120
121
- // Check if we have JavaScript support
122
- document . querySelector ( ':root' ) . classList . add ( 'has-js' ) ;
121
+ document . addEventListener ( 'DOMContentLoaded' , function ( ) {
122
+ // Check if we have JavaScript support
123
+ document . querySelector ( ':root' ) . classList . add ( 'has-js' ) ;
123
124
124
- // Restore user mode preferences
125
- setupTheme ( ) ;
125
+ // Restore user mode preferences
126
+ setupTheme ( ) ;
126
127
127
- // Handle pickers with click/taps rather than hovers
128
- setupPickers ( ) ;
128
+ // Handle pickers with click/taps rather than hovers
129
+ setupPickers ( ) ;
129
130
130
- // Track when the header is in sticky position
131
- setupStickyHeaders ( ) ;
131
+ // Track when the header is in sticky position
132
+ setupStickyHeaders ( ) ;
133
+ } , { once : true } ) ;
Original file line number Diff line number Diff line change @@ -74,6 +74,6 @@ <h1>Node.js __VERSION__ documentation</h1>
74
74
</ div >
75
75
</ div >
76
76
</ div >
77
- < script src ="assets/api.js " type ="text/javascript "> </ script >
77
+ < script defer src ="assets/api.js " type ="text/javascript "> </ script >
78
78
</ body >
79
79
</ html >
You can’t perform that action at this time.
0 commit comments