title: How to get current URL with JavaScript?
body: <p>I have this portion of the code. I want to know how can I read the url as the current page instead a fix url</p>
  
  <p>Here is the portion of the coding:</p>
  
  <pre><code>var str='';
        if(model_id != 0 ) str = model_id+"+";
        if(year_id != 0 ) str +=year_id+"+"; 
        url='http://store.ijdmtoy.com/SearchResults.asp?Search='+str;
  top.location.href=url;
  </code></pre>
  
  <p>You see currently it has a fix reading the url  <a href="http://store.ijdmtoy.com/SearchResults.asp" rel="nofollow">http://store.ijdmtoy.com/SearchResults.asp</a></p>
  
  <p>For example, I am currently on <a href="http://store.ijdmtoy.com/abs.htm" rel="nofollow">http://store.ijdmtoy.com/abs.htm</a></p>
  
  <p>How can I change the code so it will automatically read as <a href="http://store.ijdmtoy.com/abs.htm?searching=Y&amp;Search" rel="nofollow">http://store.ijdmtoy.com/abs.htm?searching=Y&amp;Search</a></p>