How to get the current URL from JavaScript

Asked 1 years ago, Updated 1 years ago, 90 views

I use jQuery. How can I get the current URL path? For example http://localhost/menuname.de?foo=bar&number=0 I mean, this url.

javascript jquery path url

2022-09-22 21:59

1 Answers

var pathname = window.location.patchname; // Return path only
varl = window.location.href; // Return all URLs


2022-09-22 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.