Skip to content

Instantly share code, notes, and snippets.

@natanfeitosa
Created May 24, 2022 01:07
Show Gist options
  • Save natanfeitosa/6f9a7c1010357c7e9de35810adaa3f0d to your computer and use it in GitHub Desktop.
Save natanfeitosa/6f9a7c1010357c7e9de35810adaa3f0d to your computer and use it in GitHub Desktop.
document.addEventListener('click', e => {
if(e.target.tagName.toUpperCase() == 'A') {
e.stopPropagation()
e.preventDefault()
var data_container=jquery(e.target).attr('data-container');
if(data_container){
var title=jquery(e.target).attr('title');
var url=jquery(e.target).attr('href');
jquery('body').html('');
path=url.split('/')[1];
console.log({path})
router(path);
return false;
}else{
return true;
}
console.log('opa')
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment