SoFunction
Updated on 2025-04-10

Get the current url

For example: http://localhost/newurl/
1. Method (note the upper and lower case)
The result is: http://localhost/newurl/

(),
Results: http://localhost/newurl/

;
Results:/newurl/

Remark:
If the current URL is
http://localhost/?user=tinyfool&tag=%BC%BC%CA%F5
What I got through () is
http://localhost/?user=tinyfool&tag=¼¼Êõ
This is obviously wrong, what should I do? Use it well, this is the correct one. :)


Take the url value
A small example I just wrote. It is still quite a lot of use in practice.


[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]