Note that there are some explanatory texts on larger screens.

plurals
  1. POJQUERY Mobile Database Results Retrieval List View
    primarykey
    data
    text
    <p>I am trying to build a dynamic jquery mobile list view based off results from a database. I have the following code:</p> <pre class="lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;// &lt;![CDATA[ $(document).ready(function() { $.ajaxSetup({ cache: false }); // This part addresses an IE bug. without it, IE will only load the first number and will never refresh setInterval(function() { $('#results').load('./Display.php?id=100'); }, 3000); // the "3000" here refers to the time to refresh the div. it is in milliseconds. }); // ]]&gt;&lt;/script&gt; </code></pre> <p>and</p> <p><code>&lt;div id="results"&gt;&lt;/div&gt;</code></p> <p>Display.php has a while loop </p> <pre class="lang-php prettyprint-override"><code>while($row = mysql_fetch_array($query)) { echo "{$row['title']} {$row['message']} {$row['datetime']} &lt;/br&gt; "; } </code></pre> <p>At the moment this just outputs title, message and datetime on the .html and php pages but I want to use this with:</p> <pre><code>&lt;ul data-role="listview" data-inset="true"&gt; &lt;li&gt;&lt;a href="index.html"&gt; &lt;h3&gt;Stephen Weber&lt;/h3&gt; &lt;p&gt;&lt;strong&gt;You've been invited to a meeting at Filament Group in Boston, MA&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Hey Stephen, if you're available at 10am tomorrow, we've got a meeting with the jQuery team.&lt;/p&gt; &lt;p class="ui-li-aside"&gt;&lt;strong&gt;6:24&lt;/strong&gt;PM&lt;/p&gt; &lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I have tried a number of ways to get this working but it doesn't seem to, I have cleaned the while loop code up so its basic for this question. Has anyone managed to do this? Normally I would just run the <code>&lt;li&gt;&lt;/li&gt;</code> through a foreach but this is different. Any help would be greatly appreciated.</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.
    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