Search code snippets, questions, articles... Chrome Extension

Javascript getAbsolutePath

//Javascript get current url 
function getAbsolutePath() {
    var loc = window.location;
    var pathName = loc.pathname.substring(0, loc.pathname.lastIndexOf('/') + 1);
    return loc.href.substring(0, loc.href.length - ((loc.pathname + + loc.hash).length - pathName.length));
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

Get Current Url Path With Javascript

Was this helpful?
Join Devsheet Ask a Question