http://dirtypop.tistory.com/19
제목: location.href와 location.reload 차이점
웹/컴퓨터 | 2015/03/10 10:36 | Posted By 바오밥 DirtyPOP
location.href 와 location.reload 의 결정적인 차이점
둘다 같은 페이지를 불러온다는 가정하에서,
windows.location.href
url주소의 메소드인 get은 되자만, post 데이터는 포함하지 않는다.
또한 url 주소에 '#' (앵커) 포함되어 있다면, 불러올 수 없다.
window.location.reload()
url주소의 메소드인 get과 post 데이터는 둘다 포함한 상태에서 새로고침이 된다.
또한 괄호 안의 값이 true 또는 false 로 나뉘는데
window.location.reload(true) 로 새로고침시, 서버로부터 캐시값이 아닌 다시 전부 새로 불러온다.
반면 window.location.reload(false) 로 새로고침시, 서버가 아닌 클라이언트PC 에서 캐시값으로 다시 불러온다.
덧글