Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>you didn't add the iframe tags while building the <code>&lt;li&gt;</code> it the success function</p> <p>all you did was adding (for each row):</p> <pre><code>&lt;li id="54" class="quote-wrap-group"&gt; &lt;div class="quote"&gt; &lt;p&gt;fdggfdgdgdgfdg&lt;/p&gt; &lt;/div&gt; &lt;/li&gt; </code></pre> <p>a better approach will be to make the whole list items on server side, and echo it, and then append the html that you received in the <i>success</i> to the existing list</p> <p>for example:</p> <p>your php will look like this:</p> <pre><code>$data = getData();//Get the data from the database here; foreach($data as $row): ?&gt; &lt;li id="qoute-&lt;?php echo $row["id"];?&gt;" class="quote-wrap group"&gt; &lt;span&gt; &lt;iframe src="http://www.facebook.com/plugins/like.php?href=&lt;?php echo row["id"];?&gt;&amp;amp;send=false&amp;amp;layout=button_count" style="border: medium none; overflow: hidden; width: 115px; height: 21px;" allowtransparency="true" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt; &lt;/span&gt; &lt;div class="quote"&gt;&lt;p&gt;&lt;?php echo $row["quote"];?&gt;&lt;/p&gt;&lt;/div&gt; &lt;/li&gt; &lt;?php endforeach; ?&gt; </code></pre> <p>your javascript function will be:</p> <pre><code>function getQuotes(start, limit){ $.ajax({ url:"quotes.php?start=" + start + "&amp;limit=" + limit, dataType: "html", success: function(response){ $("ul.recent-list").append(response); } }); } </code></pre> <p>this of course trying to show the principle, and not necessarily be the exact code you need to write. You need to add the other functionality (like hiding the previous quotes etc...)</p>
 

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