For getting the Full URL write the following code.
var CurrentUrl = window.location.href;
If you need only the path, write the following code.
var PathName = window.location.pathname;
In Jquery we can get the URl in the following method also.
var URL = $(location).attr('href');