1. 자바스크립트 location과 history 객체
1.1 location 객체 간단하게 알아보기
const naver = 'https://www.naver.com'
1. href
location.href = naver;
2. assign()
location.assign(naver);
3. replace()
location.replace(naver);
4. host
location.host
ex) 'www.naver.com'
5. origin
location.origin
ex) 'https://www.naver.com'
6. pathname
ex) 'https://section.cafe.naver.com/ca-fe/home' 에서 사용시
location.pahtnmae
1.2 history 객체 간단하게 알아보기
location은 브라우저 기록을 편집할 수 있는 객체이다.
1. back()
history.back();
2. forward()
history.forward();
3. length
history.length;
4. go()
history.go(-2)
history.go(1)
1.3 navigator 객체 간단하게 알아보기
- 브라우저와 유저의 운영체제와 상호작용이 가능하도록 함
1. geolocation
navigator.geolocation.getCurrentPosition((data)=>{console.log(data)})
'이후 위치 정보를 확인하겠다는 알람이 뜨고 확인을 누르면 console.log()에 위도와 경도 등 주소를 알려줌.'
2. clipboard