title: Get html url var
body: <p>i am using the code bellow to send a variable to another page but i got "undefined"</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  
  $('.letterz').click(function () {
  var selectedletter = $(this).attr("id");
  $("#celebdetails").load("reveal.html?surname="+selectedletter, function() {
  $('.myloader').fadeOut("fast");
  $('#celebdetails').fadeIn("slow");
  });
  });
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>my html</strong></p>
  
  <pre><code>&lt;div class="myloader"&gt;&lt;/div&gt;
  
  &lt;div id="#celebdetails" style="display:none;"&gt;&lt;/div&gt;
  
  &lt;div class="letterz" id="A"&gt;&lt;/div&gt;
  &lt;div class="letterz" id="B"&gt;&lt;/div&gt;
  &lt;div class="letterz" id="C"&gt;&lt;/div&gt;
  &lt;div class="letterz" id="D"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And in the second page that i am sending the parameter surname i am using the code below to fetch it:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  
  function getUrlVars()
  {
      var vars = [], hash;
      var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;');
      for(var i = 0; i &lt; hashes.length; i++)
      {
          hash = hashes[i].split('=');
          vars.push(hash[0]);
          vars[hash[0]] = hash[1];
      }
      return vars;
  }
  
  var me = getUrlVars()["surname"];   
  alert(me);
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Thanks in advance</p>