Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1374665
README.md
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
510 B
Referenced Files
None
Subscribers
None
README.md
View Options
#
add
-
to
-
head
A
simple
library
that
lets
you
dynamicall
add
some
CSS
or
JS
to
the
HEAD
of
your
HTML
document
.
If
the
JS
or
CSS
asset
is
already
present
in
the
document
,
it
'
s
not
added
a
second
time
.
```
lang
=
js
import
{
addCSS
,
addJS
}
from
"@sealcode/add-to-head"
;
addCSS
(
"/my/style.css"
);
// adds a css file to the DOM
addCSS
(
"/my/style.css"
);
// called second time, will not add another style link to the DOM
await
addJS
(
"/my/script.js"
)
// add a JS script to the DOM and await until it is loaded
```
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Feb 25, 05:44 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
610374
Default Alt Text
README.md (510 B)
Attached To
Mode
rATOH add-to-head
Attached
Detach File
Event Timeline
Log In to Comment