title: I need to run a function if the URL has a specific string that can also come up as part of another string using jQuery or Javascript
body: <p>I need to write a function to perform an action only if the URL has a specific string.  The issue that I am finding is that the string can come up in multiple instances as part of another string.  I need the function to run when the string is ONLY "?page=1".  What I am finding is that the function is also being run when the string contains a string like "?page=10" , "?page=11" , "?page=12" , etc...  I only need it to be done if the string is "?page=1" - that's it.  How do I do that?  I've tried a couple of different ways, but it does not work.  Any help is appreciated.  Here is the latest code that I have used that is close...but no cigar.</p>
  
  <pre><code>var location = window.location.href; 
  if (location.indexOf("?page=1") &gt; -1){
  //Do something
  };
  </code></pre>