본문 바로가기
Script

도메인 정보

by 자바초보자 2015. 12. 9.
728x90
  var targetDomain = window.location.href.match(/:\/\/(.[^/]+)/)[1];
  console.log("targetDomain : "+targetDomain);
  console.log("location.protocol : "+location.protocol );
  console.log("location.host  : "+location.host  );
  console.log("location.pathname  : "+location.pathname  );
  console.log("location.search  : "+location.search  );

 

728x90