1. 전체 URL을 문자열로 설정하거나 가져옵니다.
Window.location.href
2. URL과 관련된 포트 번호를 설정하거나 가져옵니다.
Window.location.port
3. URL의 프로토콜 부분을 설정하거나 가져옵니다.
Window.location.protocol
4. 물음표를 따르는 HREF 속성의 일부를 설정하거나 얻으십시오.
Window.location.search
5. 변수의 값을 얻으십시오 (동일 부호 후 부품을 가로 채기)
코드 사본은 다음과 같습니다.
var url = window.location.search;
// alert (url.length);
// alert (url.lastIndexof ( '='));
var loc = url.substring (url.lastindexof ( '=')+1, url.length);
6. URL의 프로토콜 부분을 설정하거나 가져옵니다.
Window.location.protocol
7. 파운드 부호 "#"후에 HREF 속성에서 세그먼트를 설정하거나 가져옵니다.
Window.location.hash
8. 위치 또는 URL의 호스트 이름 및 포트 번호를 설정하거나 가져옵니다.
Window.location.host