jquery get current url

JavaScript
var currentURL = $(location).attr('href'); //jQuery solution
var currentURL = window.location.href; // raw javascriptvar currentURL = $(location).attr('href'); 
var currentURL = window.location.href;var pathname = window.location.pathname;
Source

Also in JavaScript: