window.location.href or window.location.search
<p>I want to extract out the query string values from the URL. </p>

<p>So, in the most upvoted answer in <a href="https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript">How can I get query string values in JavaScript?</a> - <code>window.location.search</code> is used.</p>

<p>Is there any problem in using <code>window.location.href</code>?</p>

<p>I am trying to root cause a problem where in sometimes I am getting empty query string value when using <code>location.href</code></p>