title: Last If statement ignored
body: <p>My last <code>if</code> statement is ignored when executing.</p>
  
  <p>When trying to debug I added <code>console.log</code> to the if statement and it functioned as expected.</p>
  
  <pre><code>$(document).ready(function() {  
      // set HTML
      var myVar = 'Null';
      if ( document.location.href.indexOf('?1501aa') &gt; -1 ) {
          myVar = '01';
      }
      if ( document.location.href.indexOf('?1501ab') &gt; -1 ) {
          myVar = '02';
      }
      if ( document.location.href.indexOf('?1501ac') &gt; -1 ) {
          myVar = '03';
      }
      if ( document.location.href.indexOf('?1501ad') &gt; -1 ) {
          myVar = '04';
      }
      if ( document.location.href.indexOf('?1501ae') &gt; -1 ) {
          myVar = '05';
      }
      if ( document.location.href.indexOf('?1501af') &gt; -1 ) {
          myVar = '06';
      }
      if ( document.location.href.indexOf('?1501ag') &gt; -1 ) {
          myVar = '07';
      }
      if ( document.location.href.indexOf('?1501ah') &gt; -1 ) {
          myVar = '08';
          //console.log('myVar set to' + myVar);
      }
      if ( document.location.href.indexOf('?1501aj') &gt; -1 ) {
          myVar = '09';
          //console.log('myVar set to' + myVar);
      }
      else {
          setText();
      }
      function setText() {
          $('&lt;label for="name"&gt;' + myVar + '&lt;/label&gt;').insertBefore($('#name'));
      }
  });
  </code></pre>
  
  <p>The <a href="http://jsfiddle.net/L0a2g070/16/" rel="nofollow">jsFiddle example</a> isn't perfect due to the way they handle URLs.</p>
  
  <p>How can I get the last if statement to return true and execute?</p>