location get jquery code example
Example 1: jquery get url
var currentURL = $(location).attr('href');
var currentURL = window.location.href;
Example 2: jquery get URL slug
var pathname = window.location.pathname;
var currentURL = $(location).attr('href');
var currentURL = window.location.href;
var pathname = window.location.pathname;