Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

1
Append script into the body before closing using JavaScript
Post Body

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!

Author
Account Strength
100%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
5,756
Link Karma
608
Comment Karma
5,077
Profile updated: 3 days ago
Posts updated: 5 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago