Is there a way to prevent the error "loadWithAjax is not defined" from occurring while using the script below?
addEventListener('click', function (ev) {
if (ev.target.classList.contains('bpb')) {
ev.preventDefault();
loadWithAjax(ev.target.href);
}
});
I am trying to avoid skip links adding #xxx to the URL. If there is a more efficient method, I am open to suggestions :-)
<div id="access" role="region" aria-label="Skip links">
<ul class="list-unstyled">
<li><a class="bpb" href="#navigation">Skip to primary navigation</a></li>
<li><a class="bpb" href="#chapter-content">Skip to main content</a></li>
</ul>
</div>
Thank you