Location.search : Location : Location JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Location » Location »

 

Location.search








The search property represents the query portion of the URL, including the preceding question mark.

For example, the search for http://www.navioo.com/search.htm?term=javascript is ?term=javascript.












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







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Location
» Location