‘ +
‘
‘ +
‘‘ + coindatagetDesktop + ‘‘ +
‘Trade Now’ +
‘
‘ +
”
);
}
}
document.addEventListener(‘DOMContentLoaded’, function () {
let trendingLoaded = false;
document.querySelectorAll(‘.tab-link’).forEach(function (tab) {
tab.addEventListener(‘click’, function () {
const tabId = this.getAttribute(‘data-tab’);
// Load trending via AJAX only once
if (tabId.startsWith(‘tab-2’) && !trendingLoaded) {
trendingLoaded = true;
const postId = tabId.replace(‘tab-2’, ”);
fetch(‘https://coingape.com/wp-admin/admin-ajax.php?action=load_trending_posts¤t_id=’ + postId)
.then(res => res.json())
.then(data => {
if (data.success) {
document.querySelector(‘#’ + tabId + ‘ .Newscover’).innerHTML = data.data;
}
})
.catch(() => {
document.querySelector(‘#’ + tabId + ‘ .Newscover’).innerHTML = ‘
Failed to load
‘;
});
}
});
});
});
–>




Be the first to comment