Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.85 KB | None | 0 0
  1. <html>  
  2. <head>  
  3.     <title>Javascript Location Search</title>  
  4.     <script type="text/javascript" language="javascript">  
  5.         function getLocationSearch() {  
  6.             document.getElementById("div1").innerHTML = window.location.search;  
  7.         }  
  8.  
  9.         function setLocationSearch(valueObj) {  
  10.             window.location.search = valueObj;  
  11.         }  
  12.     </script>  
  13. </head>  
  14. <body onload="getLocationSearch();">  
  15.     <div id="div1">  
  16.     </div>  
  17.     <br />  
  18.     <br />  
  19.     <input type="button" id="btn"  
  20.            value="Set New Location Search"  
  21.            onclick="setLocationSearch('?q=new-value');" />  
  22.     <br />  
  23.     <br />  
  24.     <input type="button" id="Button1"  
  25.            value="Set Old Location Search"  
  26.            onclick="setLocationSearch('?q=old-value');" />  
  27. </body>  
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement