I have a current URL:
http://www.test.com/p1234?utm_source=....
How do I get a URL with the format http://www.test.php/p1234
I am using javascript document.URL, the result is http://www.test.com/p1234?utm_source=....
This is the correct answer:
window.location.host + window.location.pathname;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With