Created
May 24, 2022 01:07
-
-
Save natanfeitosa/6f9a7c1010357c7e9de35810adaa3f0d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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