#3525 - $util.url is naive
0 guests and 0 members have recently viewed this.
The top 3 point earners from 7th Dec 2025 to 14th Dec 2025.
| PDStig |
|
|
|---|---|---|
| Gabri |
|
|
| Master Rat |
|
|
There are no events at this time
I introduced a new function called $util.rel() for producing root-relative URLs and used it throughout the JS where appropriate. $util.url() is a general purpose function that returns a "URL"[1] instance, which can be used for URL manipulation, modifying the query string etc. but unfortunately it only works with absolute URLs.
The reason for using the tempcode {$BASE_URL} in $util.url() is to avoid UTIL.js having any dependency on CMS.js. $cms.getBaseUrl() would work too, should I switch?
1: https://developer.mozilla.org/en-US/docs/Web/API/URL