Link.pathname

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							link.pathname

Description

The pathname property of the Link object represents the pathname portion of the link URL.

Example

Listing 7.373 shows how the pathname property is used. When the button is clicked, the showpathname function is executed. This displays the pathname for the link.

Listing 7.373 Example of the pathname Property
<html>
<head>
<title> Using the pathname property of the Link object</title>
</head>
<body>

<script language="JavaScript">
<!--Hide

// displays the pathname for the specified URL
function showpathname(){
     document.form1.text1.value = document.links[0].pathname;
}
// End Hide --->
</script>
							 Click the button to see the pathname for the ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.