- From: Luca Barbato <notifications@github.com>
- Date: Fri, 14 Jul 2023 00:46:49 -0700
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 14 July 2023 07:46:56 UTC
I found the problem while looking at how the url fragment is supported across languages while working at another standard, so I cannot tell you how widespread this need is within JS, I guess we'll have to make a note and signal the pitfall.
What is surprising me even more is that you do not get what you set.
``` javascript
let url = new URL("scheme://host/path/");
console.log(url.hash);
url.hash = "#";
console.log(url.toString()); // -> scheme://host/path/#
console.log(url.hash); // -> ''
url.hash = "#a";
console.log(url.toString()); // -> scheme://host/path/#a
console.log(url.hash); // -> '#a'
```
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/779#issuecomment-1635445609
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/url/issues/779/1635445609@github.com>
Received on Friday, 14 July 2023 07:46:56 UTC