Uri class and parser

Adam D. Ruppe destructionator at gmail.com
Wed Oct 24 13:36:50 PDT 2012


On Wednesday, 24 October 2012 at 19:54:54 UTC, Jacob Carlborg 
wrote:
> A nitpick, I'm not really an expert on URI's but is "fragment" 
> really the correct name for that I would call the "hash"? That 
> would be "nose" in the example below.

Yes, that's the term in the standard.

http://en.wikipedia.org/wiki/Fragment_identifier

Javascript calls it the hash though, but it is slightly 
different: the # symbol itself is not part of the fragment 
according to the standard.

But javascript's location.hash does return it.

URL: example.com/
>>> location.hash
""

>>> location.hash = "test"
"test"

URL changes to: example.com/#test

>>> location.hash;
"#test"



The fragment would technically just be "test" there.


More information about the Digitalmars-d mailing list