I mentioned this on another similar post also – wanted to xpost it here to make sure people finding this one in search are also aware.
I was having similar issues, and upon viewing the source of the page served, found that Discourse was stripping out the inline Javascript entirely.
This post mentions it:
but I don’t see a solution there.