Skip to content

Commit

Permalink
fix: only attempt to attach ad if sidebar ad container exists
Browse files Browse the repository at this point in the history
  • Loading branch information
pd93 committed Dec 25, 2023
1 parent c569cbc commit 685a6f3
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions docs/static/js/carbon.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
(function () {
function attachAd() {
var el = document.createElement('script');
el.setAttribute('type', 'text/javascript');
el.setAttribute('id', '_carbonads_js');
el.setAttribute(
'src',
'//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev'
);
el.setAttribute('async', 'async');

var wrapper = document.getElementById('sidebar-ads');
wrapper.innerHTML = '';
wrapper.appendChild(el);
if (wrapper) {

var el = document.createElement('script');
el.setAttribute('type', 'text/javascript');
el.setAttribute('id', '_carbonads_js');
el.setAttribute(
'src',
'//cdn.carbonads.com/carbon.js?serve=CESI65QJ&placement=taskfiledev'
);
el.setAttribute('async', 'async');

wrapper.innerHTML = '';
wrapper.appendChild(el);
}
}

setTimeout(function () {
Expand Down

0 comments on commit 685a6f3

Please sign in to comment.