Area pathname 属性

定义和用法
pathname 属性可设置或返回href属性值中的路径名部分。
语法
areaObject.pathname=path
浏览器支持
所有主要浏览器都支持 pathname 属性
提示和注释
注意:在以下实例中, IE 和 Opera 返回 "js-ref/venus.htm", 但是 Firefox, Chrome, 和 Safari 返回 "/js-ref/venus.htm".
实例
下面的例子可返回 "Venus" 区域中href属性值中的路径名:
<img src="/examples/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浏览器返回 "js-ref/venus.htm", 而Firefox, Chrome, 和 Safari浏览器返回 "/js-ref/venus.htm".</p>
