How to get current URL in JavaScript

To get current URL in JavaScript you just need to use the URL property of the document object.

Sample Javascript

var currUrl = document.URL;

for more informations see The absolute URI of the document

Please Share us:
Please rate this snippet

2 thoughts on “How to get current URL in JavaScript

Leave a Reply