Do you have to insert JavaScript into header or footer only?
-
Is it possible to insert the JS code below without putting it in the header or footer of a specific page? The widget shows up twice because the plugin only gives you those two options. I installed this plugin since I don’t know how to insert JS code any other way with WordPress.
<script>(function() {
var script = document.createElement(‘script’), pg_id = Date.now()+(Math.random()*(999-100)+100);
document.write(‘<div id=”docalyticsdocbox_’+pg_id+'” style=”display:none”></div>’);
script.src = ‘//app.docalytics.com/static/embeds/js/doc_box.js#865b0dd9-fe04-11e3-98ef-e1d8900ed8c7:’+pg_id+’:0:0:wide:f7cb38:307feb:ffffff’;
script.async = true; script.className=’docalytics_docbox_loader’
var entry = document.getElementsByTagName(‘script’)[0];
entry.parentNode.insertBefore(script, entry);
})();</script>https://www.ads-software.com/plugins/css-javascript-toolbox/
- The topic ‘Do you have to insert JavaScript into header or footer only?’ is closed to new replies.