Note that there are some explanatory texts on larger screens.

plurals
  1. POParameters are passing but not retrieving when mobile.changepage in jquerymobile
    primarykey
    data
    text
    <p>Hello I have a search field with search button and two drop-down list values when i click the search button i want to pass the parameter values using mobile.change method.I am using like following structure</p> <p><strong>page1.html</strong> </p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;title&gt;Client View&lt;/title&gt; &lt;link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" /&gt; &lt;script src="js/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).on('pagebeforeshow',function(){ $("#searchbutton").on('click',function(){ var searchvalue = $("[name='clientsearch']").val(); var searchbyvalue = $("#select-choice-searchby").val(); var statusvalue = $("#select-choice-status").val(); $.mobile.changePage( 'accountlist.html', { //dataUrl : "accountlist.html?searchvalue="+searchvalue&amp;"searchbyvalue="+searchbyvalue&amp;"statusvalue="+statusvalue , data : { 'searchvalue' : searchvalue,'searchbyvalue':searchbyvalue,'statusvalue':statusvalue }, reloadPage : false, changeHash : true }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;!--Client Page--&gt; &lt;div data-role="page" id="client" data-add-back-btn="true" &gt; &lt;div data-role="header" data-theme="b" data-position="fixed" data-id="persistantFooter"&gt; &lt;h1&gt;Client View&lt;/h1&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;div data-role="fieldcontain" id="searchbox"&gt; &lt;input type="search" name="clientsearch" value="" data-inline="true" data-mini="true"/&gt; &lt;input type="button" value="Search" data-inline="true" data-theme="b" data-mini="true" id="searchbutton"/&gt; &lt;/div&gt; &lt;div data-role="fieldcontain" &gt; &lt;label for="select-choice-searchby" class="select" data-inline="true" style = "width: 90px"&gt;Search By:&lt;/label&gt; &lt;select name="select-choice-searchby" id="select-choice-searchby" data-inline="true" data-mini="true" style = "float: right"&gt; &lt;option value="account"&gt;Account&lt;/option&gt; &lt;option value="customhouseholds"&gt;Custom Households &lt;/option&gt; &lt;option value="roahouseholds"&gt;ROA Households&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div data-role="fieldcontain" &gt; &lt;label for="select-choice-status" class="select" data-inline="true" style = "width: 90px"&gt;Status:&lt;/label&gt; &lt;select name="select-choice-status" id="select-choice-status" data-inline="true" data-mini="true" style = "float: right"&gt; &lt;option value="open"&gt;Open&lt;/option&gt; &lt;option value="closed"&gt;Closed &lt;/option&gt; &lt;option value="all"&gt;All&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>page2.html:</strong></p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt; &lt;title&gt;Account view&lt;/title&gt; &lt;link rel="stylesheet" href="css/jquery.mobile-1.3.2.min.css" /&gt; &lt;script src="js/jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).on('pagebeforeshow',function(){ alert("hi"); // var parameters = window.location.pathname.split("?")[1]; //alert(getUrlVars()) var searchvalue = getUrlVars()[0]; var searchbyvalue = getUrlVars()[1]; var statusvalue = getUrlVars()[2]; alert(searchvalue); function getUrlVars() { var qName = [], hash; var qVal=[]; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&amp;'); for(var i = 0; i &lt; hashes.length; i++) { hash = hashes[i].split('='); qName.push(hash[0]); qVal.push(hash[1]); qName[hash[0]] = hash[1]; } return qVal; } }); // JavaScript Document &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page" id="accountlist" data-add-back-btn="true" &gt; &lt;div data-role="header" data-theme="b"&gt; &lt;h3&gt;Account View&lt;/h3&gt; &lt;/div&gt; &lt;div data-role="content"&gt; &lt;/div&gt; &lt;!--content--&gt; &lt;/div&gt;&lt;!--page--&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>in the page2.html we cannot access the parameter values and also the script function not execute how to fix this</p>
    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.
 

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