title: How do I use the jqm.page.params.js plugin?
body: <p>I am working with jquery mobile and I am trying to pass variables within the same page.</p>
  
  <pre><code>&lt;a href="page2.html?var1=foo&amp;var2=bar"&gt;link1&lt;/a&gt;
  &lt;a href="page2.html?var1=something&amp;var2=bbq"&gt;link2&lt;/a&gt;
  </code></pre>
  
  <p>After clicking on the link the page will be placed into the DOM.  I understand that I will have to reload the page to allow for the new variables to be applied, but I have not been successfull doing this with the:</p>
  
  <pre><code>$.mobile.changePage("page2.html", {reloadPage : true,});
  </code></pre>
  
  <p>When the page loads I am using the following:</p>
  
  <pre><code>$(document).delegate('#page2','pageinit', function(){           
  
     $.mobile.changePage("page2.html", {reloadPage : true});          
  
  });
  </code></pre>
  
  <p>The above code will just take the page in a forever loop, which is obviously not what I want.  I tried to take the changePage out side of the pageinit, but the reason for needing it inside the pageinit is for the back button to work.  So then I thought that that maybe I could get the variables from the url, so I tried the following with the use of the <a href="https://github.com/jblas/jquery-mobile-plugins/blob/master/page-params/jqm.page.params.js" rel="nofollow">jqm.page.params.js</a>:</p>
  
  <pre><code>$(document).delegate('#page2','pageinit', function(){           
  
     if ($.mobile.pageData &amp;&amp; $.mobile.pageData.proj_id){
        console.log("Parameter var1=" + $.mobile.pageData.var1);//does not print at all.
     }
  
     console.log("Parameter obj =" + $.mobile.pageData); // prints NULL           
  
  });
  </code></pre>
  
  <p>I found in the documentation a link to the plugin which is suppose to allow you to use the parameters in the url called <a href="https://github.com/jblas/jquery-mobile-plugins/blob/master/page-params/jqm.page.params.js" rel="nofollow">jqm.page.params.js</a> but there is no examples on how to use this plugin.</p>
  
  <p>Is there anyone here that knows how to use this plugin?  Or is there a better way on passing variables when you are on the same page linking to the same page but with different variables?</p>