Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to refresh/reload a page before loading in jQuery mobile?
    primarykey
    data
    text
    <p>I have an issue that I am not getting the data when redirecting to the page when clicking. The data is getting only when the page is refreshed once.</p> <p>Can someone help me to refresh one time the page before loading or after loading?</p> <p>Thanks</p> <p>here is the code</p> <pre><code>&lt;?php include('libraries/config.php'); $getID = $_GET['id']; echo $getID; $stmt = $db-&gt;prepare("SELECT * FROM category where categoryID = ?"); if ($stmt-&gt;execute(array($_GET['id']))) { while ($row = $stmt-&gt;fetch()) { // print_r($row); // echo $row['tips']; $sol = $row['tips'];; $str= $sol; preg_match_all('/"(.*?)"/', $str, $matches); //print_r(array_map('intval',$matches[1])); $int_arr = array_map('intval',$matches[1]); //print_r($int_arr); foreach ($int_arr as $x) { $stmt1 = $db-&gt;prepare("SELECT * FROM tip where tipID = ?"); if ($stmt1-&gt;execute(array($x))) { while ($row = $stmt1-&gt;fetch()) { // print_r($row); // echo $row['tips']; $sol = $row['title']; //echo $sol; } } } } } if(isset($_POST['tipid'])) { echo $_POST['tipid']; } ?&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta name="robots" content="noindex, follow"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;title&gt;Welcome To LensPal&lt;/title&gt; &lt;link rel="stylesheet" href="css/jquery.mobile.structure-1.3.2.min.css"&gt; &lt;link rel="stylesheet" href="css/style.css"&gt; &lt;link rel="shortcut icon" href="demos/_assets/favicon.ico"&gt; &lt;script src="js/jquery.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="engine1/style1.css" /&gt; &lt;script type="text/javascript" src="engine1/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('img').live('click', function(){ // alert(this.id); //alert(this.src); var s = this.id; var s1 = s.split("_"); var s2 = "unlike"; var s3 = s2 + "_" + s1[1]; var s4 = "like"; var s5 = s4 + "_" + s1[1]; //alert(s3); //alert(s5); if(s1[0] == "like"){ //if(this.src == "http://localhost/deepthi/acuvue-lenspal/images/ic_like_unselect.png"){ //this.src ="images/ic_like_select.png"; $("#tipid").val(1); document.getElementById(s).src="images/ic_like_select.png"; document.getElementById(s3).src="images/ic_unlike_unselect.png"; } if(s1[0] == "unlike"){ $("#tipid").val(0); document.getElementById(s).src="images/ic_unlike_select.png"; document.getElementById(s5).src="images/ic_like_unselect.png"; //this.src ="images/ic_unlike_select.png"; } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="main-wrapper"&gt; &lt;div data-role="header" id="header" data-position="fixed"&gt; &lt;div id="back-btn"&gt; &lt;a href="#" onClick="window.history.back();" &gt;&lt;img src="images/back_btn.png" width="42" height="41" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;div id="logo"&gt; &lt;/div&gt; &lt;div id="tc-btn"&gt; &lt;a href="tc_list.html" data-transition="slide"&gt;&lt;img src="images/tc_btn.png" width="42" height="41" /&gt;&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="content-area"&gt; &lt;br/&gt; &lt;div id="wowslider-container1"&gt; &lt;form action="#" method="post"&gt; &lt;div class="ws_images"&gt; &lt;ul&gt; &lt;?php if ($stmt-&gt;execute(array($_GET['id']))) { while ($row = $stmt-&gt;fetch()) { $counter =0; foreach ($int_arr as $x) { if ($stmt1-&gt;execute(array($x))) { while ($row1 = $stmt1-&gt;fetch()) { // print_r($row); //echo $row1['title']; ?&gt; &lt;li&gt;&lt;img src="engine1/bg.png" alt="" title="" id="wows1"/&gt;&lt;div&gt; &lt;span style="font-size:12px;text-transform:uppercase;"&gt;&lt;b&gt;&lt;?php echo $_GET['id'];?&gt;&lt;/b&gt;&lt;/span&gt;&lt;br &gt;&lt;span style="color:#3B8BD7;font-size:22px;"&gt;&lt;?php echo $row1['title'];?&gt;&lt;/span&gt;&lt;/div&gt; &lt;img src="images/list_hr.png" style="background-repeat:repeat-x;width:303px;height:4px;margin-top:-3px;" /&gt; &lt;span style="font-size:12px;"&gt;&lt;?php echo $row1['body'];?&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt; &lt;img src="images/list_hr.png" style="background-repeat:repeat-x;width:303px;height:4px;"/&gt; &lt;div align="center"&gt;&lt;b&gt;&lt;p style="color:#3B8BD7;font-size:14px;"&gt;Helpline?&lt;/p&gt;&lt;/b&gt; &lt;img src="images/ic_like_unselect.png" height="40" width="40" id="like_&lt;?php echo $counter;?&gt;" name="offer" /&gt;&amp;nbsp;&lt;img src="images/ic_unlike_unselect.png" height="40" width="40" id="unlike_&lt;?php echo $counter;?&gt;" name="offer"/&gt;&lt;/div&gt; &lt;input type="hidden" name="tipid" id="tipid" value="" /&gt; &lt;input type="hidden" name="tip" id="tip" value="&lt;?php echo $counter;?&gt;" /&gt;&lt;/li&gt; &lt;?php $counter++;}}}}} ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="ws_bullets"&gt; &lt;div align="center"&gt; &lt;?php if ($stmt-&gt;execute(array($_GET['id']))) { while ($row = $stmt-&gt;fetch()) { foreach ($int_arr as $x) { if ($stmt1-&gt;execute(array($x))) { while ($row1 = $stmt1-&gt;fetch()) { // print_r($row); //echo $row1['title']; ?&gt; &lt;a href="#" &gt;&lt;/a&gt; &lt;?php }}}}}?&gt; &lt;/div&gt;&lt;/div&gt; &lt;div class="ws_shadow"&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript" src="engine1/wowslider.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="engine1/script.js"&gt;&lt;/script&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.
 

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