관리 메뉴

드럼치는 프로그래머

[JavaScript] 현재 실행중이 URL정보 본문

★─Programing/☆─WebProgram

[JavaScript] 현재 실행중이 URL정보

드럼치는한동이 2017. 4. 4. 11:59

실행url - http://localhost:8088/login/login.do?key=value

 

-javascript-

 

location.href -> http://localhost:8088/login/login.do?key=value

location.protocol -> http:
location.host -> localhost:8088
location.pathname -> /login/login.do
location.search -> ?key=value


-jquery-

 

jQuery(location).attr('href') -> http://localhost:8088/login/login.do?key=value
jQuery(location).attr('protocol') -> http:
jQuery(location).attr('host') -> localhost:8088
jQuery(location).attr('pathname') -> /login/login.do
jQuery(location).attr('search')-> ?key= 
jQuery(location).attr('search')-> ?key=


[출처] http://blog.naver.com/smjh0224/120172136609

Comments