{
loading = true;
fetch($event.detail.new_url)
.then(response => response.text())
.then(data => {
let html_div = document.createElement('div');
html_div.innerHTML = data;
const button = document.querySelector('#blog-pagination .btn');
const href = button.getAttribute('href');
const url = new URL(href, window.location.origin);
const pageValue = url.searchParams.get('page');
if(pageValue && parseInt(pageValue) === parseInt(button.getAttribute('data-total-pages'))) {
document.querySelector('#blog-pagination').style.display = 'none';
}
let html_dom = html_div.querySelector('#blog-grid').innerHTML;
if (document.querySelector('#blog-grid')){
document.querySelector('#blog-grid').innerHTML += html_dom;
}
showingResultCount = document.querySelectorAll('.article-card').length
calculateProgressBarWidth(showingResultCount)
if (html_div.querySelector('#blog-pagination')){
let pagination_dom = html_div.querySelector('#blog-pagination').innerHTML;
if(document.querySelector('#blog-pagination')) {
document.querySelector('#blog-pagination').innerHTML = pagination_dom;
}
}
})
.catch(error => console.error('Error:', error))
.finally(() => loading = false);
})
">
Jul 10, 2024
Announcement
Novel Foods Application Update
Read more
Expert Tips on Supercharging Your Brain Health
Read more
Jul 10, 2024
The Best Vitamins For Healthy Hair
Read more
Jul 10, 2024
Announcement
The Matt Hampson Foundation Official Wellness Partner
Read more
Jul 10, 2024
How to Enhance Your Sleep Routine to Help You Succeed
Read more
Jul 10, 2024
Here Are The Top 10 Most Influential Sportswomen Around The World
Read more
Jul 10, 2024
Announcement
George Kruis announces retirement.
Read more
Jul 10, 2024
How To Get the Best Stairmaster Workout, According To TikTok
Read more
Jul 10, 2024
Everything You Need to Know About Exercising During Your Menstrual Cycle
Read more
Jul 10, 2024
New to CBD? Here’s everything you need to know when you’re starting out
Read more