Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have a multi-page document and you link the first page with the second one using the page id (example: href="<strong>#route-page</strong>?route=50%20Grit").</p> <p>The Javascript function getParameterByName uses the window.location.search in order to get the URL. But the URL still remains the same after the first page transition.</p> <p>Try to use the following script instead of the getParameterByName:</p> <pre><code> &lt;script type="text/javascript"&gt; $(document).bind( "pagebeforechange", function( e, data ) { if ( typeof data.toPage === "string" ) { var urlObj = $.mobile.path.parseUrl(data.toPage); var rex = /^#route-page/; if ( urlObj.hash.search(rex) !== -1 ) { var specificRouteName = urlObj.hash.replace( /.*route=/, "" ); // The specificRouteName gives you the "route" parameter. } } }); &lt;/script&gt; </code></pre> <p>Below you can find an example which is based on your code. I hope this helps you.</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.8.17/themes/base/jquery-ui.css" /&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.1.0-rc.1/jquery.mobile-1.1.0-rc.1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="home" data-theme="a"&gt; &lt;div data-role="header" data-position="fixed"&gt; &lt;h2 class="full-text"&gt;Climbing Areas&lt;/h2&gt; &lt;/div&gt; &lt;div id="home-content" data-role="content"&gt; &lt;ul id="locations" class="data" data-role="listview" data-filter="true" data-filter-placeholder="Search for location, type, or route/problem name" data-filter-theme="a" &gt; &lt;li&gt; &lt;a href="#route-page?route=mountain" data-transition="slide"&gt;Test1&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#route-page?route=sea" data-transition="flip"&gt;Test2&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- end of Home Page --&gt; &lt;!-- Route Page --&gt; &lt;div data-role="page" id="route-page" data-dom-cache="false" data-theme="a" data-cache="never"&gt; &lt;script type="text/javascript"&gt; $(document).bind( "pagebeforechange", function( e, data ) { if ( typeof data.toPage === "string" ) { var urlObj = $.mobile.path.parseUrl(data.toPage); var rex = /^#route-page/; if ( urlObj.hash.search(rex) !== -1 ) { var spesificRouteName = urlObj.hash.replace( /.*route=/, "" ); document.getElementById('tst').value = spesificRouteName; } } }); &lt;/script&gt; &lt;div data-role="header" data-position="fixed"&gt; &lt;h2 id="route-header" class="full-text"&gt;&lt;/h2&gt; &lt;a href="#home" class="ui-btn-right" data-icon="home"&gt;Home&lt;/a&gt; &lt;a href="#home" class="ui-btn-left" data-icon="arrow-l" rel="external"&gt;Back&lt;/a&gt; &lt;/div&gt; &lt;div id="route-content" data-role="content"&gt; &lt;h3 id="route-name"&gt;&lt;/h3&gt; &lt;p id="route-description"&gt;&lt;/p&gt; &lt;input id="tst" type="text" value=""&gt; &lt;div id="route-colors" class="ui-grid-e"&gt; &lt;/div&gt; &lt;div id="route-images" class="ui-grid-a"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt;&lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload