Location.pathname : Location : Location JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Location » Location »

 

Location.pathname








The pathname property represents the pathname portion of the URL.

For example, the pathname for http://www.navioo.com/pictures/index.htm is "/pictures/index.htm".












<html>
    <head>
    <title> Using the pathname property of the Location object</title>
    </head>
    <body>
    <script language="JavaScript">
    <!--
    function show(){
         alert(document.location.pathname);
    }
    -->
    </script>
    <form name="form1">
    Click the button to get the current location.pathname value of the following address:
    <br>
    http://www.navioo.com
    <br>
    <input type="button" name="getLoc" value="Get pathname" onClick='show()'>
    <br>
    </form>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Location
» Location