title: How to insert variable into jqm pageshow function
body: <p>I'm not sure if this is possible but I'm wondering how I can pass a page id to a pageshow function as below. I suspect this is the wrong way to go but the answer has alluded me. With this example passing <strong>page</strong> and appending the page id in <strong>pageshow</strong> - get   <strong>#qanda_entry_1</strong> or <strong>#qanda_entry_2</strong> etc which correspond to a series of pages in one document.</p>
  
  <p>UPDATED: code as per below from DGS</p>
  
  <p>The page transition is taking place but there is no update or rendering of the page. My data comes from a global variable 'articles_data'. I can't see how the value of 'article' in the click function can be passed to the new page? The alert 'alert(article);' is not being fired on pageshow.</p>
  
  <p>Additionally - this is for a multipage document.</p>
  
  <pre><code>$(document).on("click",".articleLink",function () {
  $(this).addClass('clicked_button');  
  var page = $(this).attr('data-page');
  var article = $(this).attr('data-id');
  //alert(article);
  $.mobile.changePage(page, {
  transition: 'slide',
  });
  });
  
  $('div[data-role="page"]').on('pageshow',function(){
  
  var page_id = $(this).prop('id');
  var article = $('.articleLink.clicked_button').attr('data-id').substr(4);
  alert(article);
  $('.articleLink.clicked_button').removeClass('clicked_button');
  
  $('#qandahead h1').empty();
  $('#qanda_text div').empty();
  jQuery.map(articles_data, function(obj) {
     if(obj.id === article){
        $('#qandahead').html('&lt;h1&gt;'+ obj.title + '&lt;/h1&gt;');
        $('#qanda_text').html('&lt;h2&gt;'+ obj.title + '&lt;/h2&gt;' +
           '&lt;p&gt;' + obj.introtext + '&lt;/p&gt;');
     } 
  
  });
  
  });
  </code></pre>
  
  <p>My listview link structure is generated dynamically </p>
  
  <pre><code>&lt;li&gt;&lt;a class="articleLink ui-link-inherit"  data-page="#qanda_entry_0" data-id="art_18"&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a class="articleLink ui-link-inherit"  data-page="#qanda_entry_1" data-id="art_9"&gt;&lt;/li&gt;
  </code></pre>
  
  <p>etc</p>