| Refresh | Home EGTry.com

use javascript to read url and query string


Version tested: ie8, firefox3
example url= http://localhost/javascript/querystring.html?name=query&value=100

location=http://localhost/javascript/querystring.html?name=query&value=100

location.search=?name=query&value=100

<html>
  <head>
    <script>

     alert("url with query string, location="+location);
     alert("get query string, location.search="+location.search);
    </script>
  </head>
  <body>


  </body>

</html>