File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change 99 */
1010
1111// see if script tag exists
12- let scrptExists = document . querySelector ( 'script#ReloadSite' ) ;
12+ ( function ( ) {
13+ let scriptExists = document . querySelector ( 'script#ReloadSite' ) ;
1314
14- if ( ! scrptExists ) {
15- // get document body
16- let body = document . querySelector ( 'body,html' ) ;
15+ if ( ! scriptExists ) {
16+ // get document body
17+ let body = document . querySelector ( 'body,html' ) ;
1718
18- if ( body ) {
19- // create tag
20- let tag = document . createElement ( 'script' ) ;
21- tag . src = 'http://127.0.0.1:{PORT}/reloadsite.js' ;
22- tag . id = 'ReloadSite' ;
23- body . append ( tag ) ;
24- } else {
25- console . warn ( 'HTML document has no body or html tag!' ) ;
19+ if ( body ) {
20+ // create tag
21+ let tag = document . createElement ( 'script' ) ;
22+ tag . src = 'http://127.0.0.1:{PORT}/reloadsite.js' ;
23+ tag . id = 'ReloadSite' ;
24+ body . append ( tag ) ;
25+ } else {
26+ console . warn ( 'HTML document has no body or html tag!' ) ;
27+ }
2628 }
27- }
29+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments