How to get the current URL in jQuery?

To get the current URL in jQuery you can use the following snippet.

Sample jQuery

$(location).attr('href');

Please Share us:
Please rate this snippet

One thought on “How to get the current URL in jQuery?

Leave a Reply