예제 :
URL = https://http://www.google.co.kr/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=html5
alert(window.location.hash); // "#q=html5"
alert(window.location.host); // "www.google.co.kr"
alert(window.location.hostname); // "www.google.co.kr"
alert(window.location.href); // "https://www.google.co.kr/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=html5"
alert(window.location.origin); // "https://www.google.co.kr"
alert(window.location.pathname); // "/webhp"
alert(window.location.port); // "" (port number)
alert(window.location.protocol); // "https:"
alert(window.location.search); // "?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8"
window.location.reload(); // webpage reloaded
window.location.replace(); // 나중에 따로 다루기로 함.
window.location.toString(); // .href와 같은 결과가 나옴.
'nodejs' 카테고리의 다른 글
ejs (html)로 유저정보 가져오기 (0) | 2021.11.26 |
---|---|
router에서 유저정보 사용하기 (0) | 2021.11.26 |
JWT 이해 (0) | 2021.11.23 |
package.json 이해 _node.js (0) | 2021.11.22 |
var, let, const 차이점 _ javascript (0) | 2021.11.09 |