HTML DOM 지역 경로 속성
정의 및 사용
경로 속성 집합 또는 href 속성 값 경로 이름 구성 요소를 반환합니다.
문법
areaObject.pathname=path
브라우저 지원
모든 주요 브라우저는 경로 속성을 지원
팁과주의 사항
참고 : 다음 예에서, IE와 오페라는 "jsref / venus.htm"를 반환하지만, 파이어 폭스, 크롬, 사파리 복귀 "/jsref/venus.htm".
예
예
다음의 예는 href 속성 값 영역 경로의 "비너스"를 반환합니다 :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif"width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
<p>金星区域的路径:
<script>
document.write(document.getElementById('venus').pathname);
</script>
</p>
<p><b>注意:</b> IE和Opera浏览器返回 "jsref/venus.htm",
而Firefox, Chrome, 和 Safari浏览器返回 "/jsref/venus.htm".</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif"width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
<p>金星区域的路径:
<script>
document.write(document.getElementById('venus').pathname);
</script>
</p>
<p><b>注意:</b> IE和Opera浏览器返回 "jsref/venus.htm",
而Firefox, Chrome, 和 Safari浏览器返回 "/jsref/venus.htm".</p>
</body>
</html>
위의 출력의 예 :
金星区域的路径: /try/demo_source/venus.htm
»시도
지역 객체