Javascript ads in handlebar templates

I work on a content site that has ad tags served to us from an ad server. They deliver in two ways, either an iframe or using a script tag that then fetches the ad using a document.write in order to collapse the ad if there is none to display.

Ember does NOT like the js version of this ad tag, and won’t display it in a handlebars template. I’m pretty sure this is due to nesting a script tag inside the handlebars (which is a script tag as well).

Is there a way to accommodate this type of ad tag inside a handlebar template?


Did you have an answer for this? We are deploying our new Beta site and we come to the same problem with 247Media ads integration.

I had a similar situation when I wanted to integrate Disqus into my Ember site. They provide you with a script tag to just stick wherever you want their content to load, but I wanted to do it the Ember way. I ended up making a DisqusView and basically duplicating the behavior of their script tag in the didInsertElement handler of the view (mostly a copy/paste job). I could go into more detail if you wanted to provide an example of their script.

We were trying to do that, but with little success. I would like to see the detail on how you include ads in Emberjs site. BTW, the 247media javascript is as follow (when you include the script as-is in the handelbar template, it does not work, but do it on a simple non-emberjs page then it works.)

the 5489… is just a random number.

forgot to take off the script tag. here it is again


script type=‘text/javascript’ src=‘