This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi everyone, I'm trying to insert a script right before closing the body tag but I keep getting errors. I don't have access to the HTML, I can only upload custom JavaScript files. I figured I would try to append the script into the HTML.
I've tried using "insertAdjacentHTML()" as well as the "appendChild()" method but neither have worked so far. Any recommendations?
This is the code I need to append/insert right before the closing body tag:
<script type="text/javascript">
(function(p,i,g,e,o,n,s){p\[o\]=p\[o\]||function(){(p\[o\].q=p\[o\].q||\[\]).push(arguments)},
n=i.createElement(g),s=i.getElementsByTagName(g)\[0\];n.async=1;n.src=e;
s.parentNode.insertBefore(n,s);})
(window,document,'script','https://static.pigeonhole.at/widget/pigeon-widget.js','phl');
phl("create", {
width: "100%",
height: "100%",
passcode: "FANATICS",
className: "pigeonhole-iframe",
sessionId: 1641202, ,
current: false,
disableBackButton: true,
/\*
profile: {
Name: "John Doe",
Email: "[email protected]",
}
\*/
});
</script>
Thanks in advance!
Subreddit
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnjavasc...