-
location.hash개발/Javascript 2022. 1. 30. 13:58
해시 값에 #만 있으면(fragment identifier가 붙지 않으면) 빈 문자열이 반환됩니다. 그렇지 않을 경우 #을 포함해 fragment identifier가 붙는 문자열을 반환합니다.
URI fragment는 위키에서 다음과 같이 나옵니다.
In computer hypertext, a URI fragment is a string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource.
The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically used to identify a portion of that document. The generic syntax is specified in RFC 3986. The hash-mark separator in URIs is not part of the fragment identifier.fragment identifier는 리소스에 종속되는 지점을 가리킵니다. 해시 마크('#')로 도입된 fragment identifier는 문서의 URL에 마지막에 선택적으로 오는 것입니다. 문서의 한 부분을 식별하기 위해 사용됩니다. 해시 마크 구분자는 fragment identifier가 아닙니다. #1234 일 때 1234가 fragment identifier라는 의미이지 # 자체는 fragment identifier가 아니라고 말하는 것입니다.
'개발 > Javascript' 카테고리의 다른 글
this (0) 2022.02.26 [tailwindcss] 최초 설정 (0) 2022.01.31 append (0) 2022.01.30 firstChild vs firstElementChild (0) 2022.01.30 [npm] install flags (0) 2022.01.26