Scripts in posts?

No I was just using that as an example. Take a look at its source code.

You could try using an iFrame if you can host the JavaScript elsewhere.

If you want tight integration you will need to consider using EmberJS.