1var currentURL = $(location).attr('href'); //jQuery solution
2var currentURL = window.location.href; // raw javascript
1window.location.pathname; // Returns path only (/path/example.html)
2window.location.href; // Returns full URL (https://example.com/path/example.html)
3window.location.origin; // Returns base URL (https://example.com)