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

n.路徑名

javascript pathname屬性 語法

作用:設(shè)置或返回當(dāng)前 URL 的路徑部分。

語法:location.pathname=path

javascript pathname屬性 示例

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

<body>

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

</body>

</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例