title: jQuery mobile, pageshow event for multiple pages
body: <p>I've got two pages, test1.html and test2.html. Every time when one of these pages gets visible I want to execute some code.</p>
  
  <p>Here are the two pages:</p>
  
  <p>test1.html:</p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;&lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;test1&lt;/title&gt;
      &lt;link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" /&gt;
      &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="js/jquery.mobile-1.2.0.js"&gt;&lt;/script&gt;
  &lt;/head&gt;&lt;body&gt;
  
  &lt;div data-role="page" id="test1"&gt;
  
      &lt;div data-role="content"&gt;
  
      &lt;a href="test2.html" data-role="button"&gt;jump to test2&lt;/a&gt;
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
  $(document).on('pageshow', '#test1', function (data) {
      alert('pageshow test1');
  });
  
  &lt;/script&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>test2.html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;&lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
      &lt;title&gt;test1&lt;/title&gt;
      &lt;link rel="stylesheet"  href="css/jquery.mobile-1.2.0.css" /&gt;
      &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="js/jquery.mobile-1.2.0.js"&gt;&lt;/script&gt;
  &lt;/head&gt;&lt;body&gt;
  
  &lt;div data-role="page" id="test2"&gt;
  
      &lt;div data-role="content"&gt;
  
      &lt;a href="test1.html" data-role="button"&gt;jump to test1&lt;/a&gt;
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).on('pageshow', '#test2', function (data) {
      alert('pageshow test2');
  });
  &lt;/script&gt;
  
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>When I start with test1.html I get the alert just for test1 (also every time when I return to it) but never for test2.html.</p>
  
  <p>What I need is a show-handler which is different for each page.</p>