How to insert a Wufoo form into an Ember app

My client asked me to integrate a Wufoo form into their Ember app and provide the following JS (anonymous):

<script type="text/javascript">var abc123;(function(d, t) {
var s = d.createElement(t), options = {
'userName':'example',
'formHash':'abc123',
'autoResize':true,
'height':'491',
'async':true,
'host':'wufoo.com',
'header':'show',
'ssl':true};
s.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + 'www.wufoo.com/scripts/embed/form.js';
s.onload = s.onreadystatechange = function() {
var rs = this.readyState; if (rs) if (rs != 'complete') if (rs != 'loaded') return;
try { abc123 = new WufooForm();abc123.initialize(options);abc123.display(); } catch (e) {}};
var scr = d.getElementsByTagName(t)[0], par = scr.parentNode; par.insertBefore(s, scr);
})(document, 'script');</script>

      

I tried to include it in index.html and also created a custom component, but I keep getting a message from Wufoo:

TypeError: Cannot set property 'innerHTML' of null

      

Is there a way to use the Wufoo JS provided in an Ember.js app?

+3


source to share





All Articles