Answers for "get path name of current url js"

8

javascript get url path

window.location.pathname
Posted by: Guest on June-06-2020
0

javascript get script path name

window.getRunningScript = () => {
    return () => {      
        return new Error().stack.match(/([^ \n])*([a-z]*:\/\/\/?)*?[a-z0-9\/\\]*\.js/ig)[0]
    }
}
console.log('%c Currently running script:', 'color: blue', getRunningScript()())
Posted by: Guest on January-07-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language