Passing Created Table Row and Data back from ajax call
I am trying to figure out how to pass the html back from an ajax call
let me give a couple snippets
jquery call
- <script>
- function add_reminder_row(){
- var rrr=confirm("Please Confirm Reminder Addition");
- if (rrr==true)
- {
- var MyData='';
- var db ="<?php echo $_SESSION['db']; ?>";
- MyData=MyData+'db='+db;
- var debug="0";
- if(document.getElementById('debug')){
- var debug = (document.getElementById('debug').checked==true ? "1" : "0"); }
- $("#main_page_div").mask_div("Waiting...");
- $.ajax( {
- url : 'ajax/add_reminder.php',
- type : 'post',
- data : MyData,
- success : function( resp ) {
- $("#main_page_div").unmask_div();
- var $response=$(resp);
- var reminder = $response.find('#reminder').html();
- $('#bill_tbody tr:last').after(reminder);
- $('#debug_div').html($('#inner_debug_div', resp).html());
- }
- });
- }
- }
- </script>
the php response, i dont seem to be passing back for example the <tr></tr>
what am I doing wrong?
- $query="SELECT * FROM sc_bill_reminder WHERE id='$id' ";
- $debug_message.=$query."<br/>";
- $rowcount=0;
- $table_data="";
- $result=mysql_query($query);
- $reminder_row=mysql_fetch_assoc($result);
- $table_data.="<tr align='center' id='budgetrow_".$rowcount."' ><td>"."<input type='button' id = 'delete_".$reminder_row['id'].":budgetrow_".$rowcount."' title ='Delete budget item ".$reminder_row['note'].".' value='X' />"."</td>";
- $table_data.="<td>".$reminder_row['bank_account_to']."</td>";
- $table_data.="<td>".$reminder_row['start_date']."</td>";
- $table_data.="<td>".$reminder_row['due_day']."</td>";
- $table_data.="<td>".$reminder_row['reminder_days']."</td>";
- $table_data.="<td>".$reminder_row['amount']."</td>";
- $table_data.="<td>".$reminder_row['note']."</td>";
- $table_data.="<td>".$reminder_row['link']."</td>";
- $table_data.="<td>".$reminder_row['chk']."</td>";
- $table_data.="<td>".$reminder_row['timestamp']."</td>";
- $table_data.="<td>"."<input type='button' id = 'edit_".$reminder_row['id'].":budgetrow_".$rowcount."' title ='Edit budget item ".$reminder_row['note'].".' value='EDIT' /></td></tr>";
- $debug_message.="END DEBUG MESSAGE<br />";
- ?>
- <div> <!-- This is empty div and please don't remove this -->
- <div id="reminder"><?php printf($table_data);?></div>
- </div>