Inject script content into <head>
See original GitHub issueHey, thanks for your awesome work!
How can I inject script content directly into <head>
tag, since
<!-- inject:js -->
<!-- endinject -->
is not valid inside <script>
tag?
Same with css contents. How can I inject css code right into the <style>
tags inside <head>
?
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Dynamically inject script into <head>? - Stack Overflow
if you want to add a script tag with src attribute to head you should use. var script= document.createElement('script'); script.src ...
Read more >Need help in injecting script to page head before DOM gets ...
I was trying to inject a script into a webpage with chrome extension before the page starts loading the dom using "content script"...
Read more >Where to put a script tag — into head or body end? - Medium
For the script to work it needs to be executed only after the target <div id=”root”>LOADING</div> is included into the DOM. For that...
Read more >How to add content in <head> section using jQuery/JavaScript?
head property: The head property of the document returns the head element of the document. Any new content can be added to this...
Read more >Add script into head section - DotNetNuke
Hi, As I am a new at DNN CMS I would like to ask for some help.I have problems with adding scripts into...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ansballard Thanks a lot! It works now.
You’re injecting into an html file, so the library assumes your start and end tags will be html comments. You’ve specified a start tag, but not an end tag, so that’s probably the issue.