Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery mobile collapsible and galaxy tab 10.1 json response gives random responses
    text
    copied!<p>Fairly new to jquery mobile and new to parsing json - have done much research to no avail. Have tried 10sec delay in settimeout function</p> <p>My app works correctly on my samsung galaxy s2 but on my samsung galaxy tablet 10.1 it does the following.</p> <p>Using latest <code>jquery 1.2.0</code> and <code>jquery-1.7.2</code></p> <p>I call <code>getlocations2.php</code> and if i return four items or less the collapsible set opens and closes correctly. If i return 5 or more items :</p> <ol> <li>i click on the top collapsible to expand it - nothing happens</li> <li>i click on second collapsible h3 and it opens first collapsible</li> <li>after that it can get random re expanding h3's but usually it is the last h3 that was touched and failed to open.</li> <li>it can work correctly for a short while.</li> </ol> <p>Thanks for any tips:</p> <p>Code :</p> <pre><code>function doajax2($vurl,$vdata,$vtype,$vfrom){ $.ajax({ url: $vurl, dataType: 'json', data:$vdata, async: false, success: function(rtndata) { $.mobile.hidePageLoadingMsg(); //alert(result.toSource()) rtndata2=(JSON.stringify(rtndata, null, 4)); rtndata2=rtndata2.substring(13); rtndata2=rtndata2.slice(0, -2) var res = eval(rtndata2); $('.displaylocations').html(''); g_html=res[0].brand; if (res[0].id&gt; -1){ g_html=g_html+'&lt;div data-role="collapsible-set" data-theme="f" &gt;'; for (var i=0;i&lt;res.length;i++){ //for (var i=0;i&lt;6;i++){ lochtml('loc',i,res[i].locid,res[i].loccode1,res[i].head,res[i].desc,res[i].lang,res[i].lat1,res[i].long1,res[i].img1,res[i].limit); } g_html=g_html+'&lt;/div&gt;'; } console.log('g_html'+g_html); $('.displaylocations').css('display','none'); $(".displaylocations").html(g_html); // $(".displaylocations").html(str); setTimeout(function(){ //make sure displaylocations has been updated $('#lhead2').html('Tuhura &lt;span lang="en"&gt;Locations&lt;/span&gt;'); $('.displaylocations').trigger('create'); $('.displaylocations').css('display','block'); $( ".displaylocations" ).collapsibleset( "refresh" ); },300); }, error: function(faildata){ switch ($vfrom) { case "region" : $("#lhead3").html('Region Info Unavailable...');break case "locs" : $("#lhead2").html('Locations Unavailable...');break; } } }); } function lochtml($vtype,$vno,$locid,$loccode1,$head,$desc,$vlang,$vlat1,$vlong1,$img1,$limit) { console.log('lochtml '+$desc); g_html=g_html+ "&lt;div class='locgoh'&gt;"; g_html=g_html+ '&lt;a href="#" onclick="getsitedetails('+"'gps','"+$locid+"','"+$loccode1+"','s','sites','"+$vlang+"',1,0,'x',"+$vlat1+","+$vlong1+')"&gt;'; g_html=g_html+ '&lt;img src="http://tuhtop.co.nz/images/rightarrow.png" width="30px" height="30px" /&gt;&lt;/a&gt;'; g_html=g_html+ '&lt;/div&gt;'; g_html=g_html+'&lt;div data-role="collapsible" class="loccollapse" data-theme="f" div="coldiv"&gt;'; g_html=g_html+ '&lt;h3&gt;'+$head+'&lt;/h3&gt;'; g_html=g_html+ '&lt;p&gt;&lt;div class="locli0"&gt;'; g_html=g_html+ '&lt;span class="li1"&gt;' +$desc+ '&lt;/span&gt;'; g_html=g_html+ '&lt;span class="li2"&gt;&lt;a href="#" onclick="getsitedetails('+"'gps','"+$locid+"','"+$loccode1+"','s','sites','"+$vlang+"',1,0,'x',"+$vlat1+","+$vlong1+')"&gt;'; g_html=g_html+ '&lt;img src=\''+$img1+'\' width=\'120"\' height=\'120\' alt=\''+$img1+'\'/&gt;&lt;/a&gt;'; g_html=g_html+ '&lt;/span&gt;'; g_html=g_html+ '&lt;/div&gt;&lt;/p&gt;'; g_html=g_html+'&lt;div class="clearfloat"&gt;&lt;/div&gt;'; g_html=g_html+'&lt;/div&gt;'; } </code></pre>
 

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