Skip to content

script outside of the html #137

Answered by valentinedwv
valentinedwv asked this question in Q&A
Discussion options

You must be logged in to vote

actually, it looks like the javascript code should be rendering to the head, but when using go library, the element is not found there.

    h.type = "application/ld+json",
        g = f.trustAsHtml(e("json")(g)),
        h.text = g,
        document.querySelector("head").appendChild(h)

Using LoadEventFired does let the script load into the head.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mafredri
Comment options

@valentinedwv
Comment options

@mafredri
Comment options

@valentinedwv
Comment options

Answer selected by valentinedwv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants