jQuery obtenir l'URL actuelle
var currentURL = $(location).attr('href'); //jQuery solution
var currentURL = window.location.href; // raw javascript
Grepper
var currentURL = $(location).attr('href'); //jQuery solution
var currentURL = window.location.href; // raw javascript
var currentUrl = window.location.href;
window.location.pathname; // Returns path only (/path/example.html)
window.location.href; // Returns full URL (https://example.com/path/example.html)
window.location.origin; // Returns base URL (https://example.com)
console.log(window.location.origin);
window.location.hostname
var currentLocation = window.location;