the html is not showing with this jquery post?

vertrox

New Member
im trying to load more data(like pagintaion) using jquery. my ajax is working, but jquery is not displaying the data the way i want it, this is my code,jquery file:\[code\]$(function () { //More Button $('.more').live("click", function () { var ID = $(this).attr("id"); if (ID) { $("#more" + ID).html('<img src="http://stackoverflow.com/questions/3753891/moreajax.gif" />'); $.ajax({ type: "POST", url: "ajax_more.php", data: "lastmsg=" + ID, cache: false, success: function (html) { $("ul#statuses").append(html); $("#more" + ID).remove(); } }); } else { $(".morebox").html('The End'); } return false; });});\[/code\]this is the html file:this is the button thats clicked to retrieve more results!\[code\]echo'<div id="more'. $dateTime.'" class="morebox"> <a href="http://stackoverflow.com/questions/3753891/#" class="more" id="'.$dateTime.'">more</a>';\[/code\]and finally the ajax_more.php file:\[code\]<?php session_start();include("includes/connect.php");include("includes/functions.php");if(isset($_POST['lastmsg'])){$lastmsg=$_POST['lastmsg'];$result="SELECT u.username, u.picture, m.id, m.user_note, m.reply_id, m.reply_name, m.recycle_id, m.recycle_name, m.dtFROM relationships r, notes m, user uWHERE m.user_id = r.leaderAND r.leader = u.user_idAND r.listener =2UNIONSELECT username, picture, id, user_note, reply_id, reply_name, recycle_id, recycle_name, dtFROM user u, notes bWHERE u.user_id = b.user_idAND b.user_id =2AND dt < '$lastmsg'ORDER BY dt DESCLIMIT 10 ";$query= mysql_query($result) or die(mysql_error().$result);while($row=mysql_fetch_array($query)){// echo the posts echo formatUpdate($row['user_note'],$row['dt'],$row['picture'],$row['username'],$row['id'],$row['reply_id'],$row['reply_name'],$row['recycle_id'],$row['recycle_name']);}?><div id="more<?php echo $row['dt']; ?>" class="morebox"><a href="http://stackoverflow.com/questions/3753891/#" id="<?php echo $row['dt']; ?>" class="more">more</a></div><?php}?>\[/code\]P.S i checked firebug and \[code\]ajax_more.php\[/code\] is returning the results data back that i wanted, but on the frontend jquery is not showing it!!
 
Back
Top