title: Getting current page url in jquery mobile
body: <p>I am trying to get the current page url in a jquery mobile site. (I am using the default ajax navigation).</p>
  
  <p>My current attempt is this (binding to pagecreate) but doesnt work on any page injected into the DOM.</p>
  
  <pre><code>$( '[data-role=page]' ).live( 'pagecreate',function(){
    $('#site-toggle').attr('href',"http://" + location.host.replace('m.','') + window.location.pathname); 
  });
  </code></pre>
  
  <p>Anyone know what I am missing?</p>
  
  <p>A.</p>