英 [p?θ'ne?m] ? 美 [p?θ'ne?m] ?

n.路徑名稱

javascript pathname屬性 語(yǔ)法

作用:設(shè)定或傳回目前 URL 的路徑部分。

語(yǔ)法:location.pathname=path

##

javascript pathname屬性 範(fàn)例

<html>
<head>
    <meta charset="UTF-8">
</head>

<body>

<script type="text/javascript">
    document.write(location.pathname);
</script>

</body>

</html>

執(zhí)行實(shí)例 ?

點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線上實(shí)例