Add table on ajax reponse

I want to add table on ajax response. But table is not showing on ajax response only contents displayed. Please help me. thanks

echo $result = " <tr> <td> Rates</td> <td style='font-size:small;'>words</td> </tr> <tr> <td></td> <td></td> </tr> <tr> <td>CHF<td> <td>".$_SESSION['calculate']['euro']."</td> </tr> <tr><td>".$_SESSION['calculate']['filename']."</td> </tr> ";

ajax on complete

onComplete: function(file, response){ //On completion clear the status status.text(''); $('<table></table>').appendTo('#files').text(response); }

--------------Solutions-------------

$('<table></table>').appendTo('#files').html(response);

You were inserting the table string as a text, not as actual html.

You are printing the result of a variable assignment (TRUE). Try removing the $result = and just echo the html.

echo "
<tr>
<td> Rates</td>
<td style='font-size:small;'>words</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td>CHF<td>
<td>".$_SESSION['calculate']['euro']."</td>
</tr>
<tr><td>".$_SESSION['calculate']['filename']."</td>
</tr>
";

Category:php Time:2011-09-17 Views:1
Tags: php ajax

Related post

  • How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice 2010-06-10

    How to add sort function for the table via ajax in ASP.NET MVC?What is the best practice. If not use Ajax, it maybe much easier, just return View, but if use AJAX, what data structure should return?I just use Json to return the data, but i found each

  • How to refresh table using Ajax 2010-02-15

    I am working on a struts application and on a jsp page, there are two controls: 1. Dropdown 2. Table When first time page loads, Table is displayed on the page using "logic:iterate" tag from struts library. Now, I have a requirement that when user ch

  • When trying to dynamically add table elements using Javascipt via innerHTML doesn't render in IE7, IE8 and IE9 2011-11-01

    I've been searching the interweb a bunch for this one and I'm stumped. The following Javascript works in Chrome, Firefox, and Safari, but for whatever reason it is not working in IE 7+. What I mean by 'not working' is that when trying to add table el

  • How to insert into mysql table using ajax? 2014-03-19

    I want to insert data into table using ajax so data will insert without reload of page. This code insert data into table very well but code also reload the page. But I want insert without reloading of page. How can i do this ? <?php include('conne

  • Add table row in jQuery 2008-10-04

    What is the best method in jQuery to add an additional row to a table as the last row? Update Is this acceptable: $('#myTable').append('<tr><td>my data</td><td>more data</td></tr>'); Are there limitations to what y

  • ADO.NET Entity Framework: Update Wizard will not add tables 2009-02-12

    I into my project and used the to add tables into the model. Five of the selected tables were added to the design surface. Two other tables will not add. I select them in the wizard and click Finish, yet they never show up on the design surface. Is t

  • How to add table background image in wicket 2010-06-01

    Can anyone please tell me how to add table background image in wicket. Actually I've tried a lot like <table background="images/logo.jpg"> also <style>table {background-image: url('images/logo.jpg')}</style> also <table style="ba

  • Add table row dynamically in Android? 2010-07-07

    I need to add table row by using Java code only (not XML design). In that table row I have to add two textview fields. I use the code below. TableRow tblrow=new TableRow(this); tblrow.addView(Textview1); tblrow.addView(Textview2); But it only display

  • Is it possible to add table cells dynamically and give them a different id? 2010-11-03

    In this fiddle you see a table with a select-field where you should select a name. Below there are 5 input-fields where one could type in some text and 3 input-fields which are set to readonly. I wanted to ask whether there is a way to add table cell

  • How to add table highlighting in PHP? 2011-04-29

    HI. I wanna know how to add table row highlighting everytime the user hovers the mouse. I was able to successfully alternate the row color. I am a total novice in web programming and have very little knowledge of javascript. Pls help me with this. He

  • How to add set of ajax loading indicators for a page 2011-08-26

    I need to add set of ajax loading indicators for a page.(different DIVs).I have successfully loaded one ajax loading indicator. <script type="text/javascript"> $(".loader").bind("ajaxSend", function () { $(this).show(); }).bind("ajaxStop", func

  • iText: Add table to all document pages 2011-09-14

    How to add table (pdfptable) with something content (text, logo etc) to all pdf-document pages after he was created (using iText with c#)? Is it possibly? --------------Solutions------------- you are going to have to use the stamper class. here is an

  • Why doesnt iText add tables which are near the page buttom to the document? 2011-10-19

    I have a lot of small tables, which i encapsulate in a sorrounding 1x1 table, and set the SplitRows attribute to false on the sorrounding table. This way, i can avoid my table getting split when it reaches the buttom of a page. When i get to the end

  • Add table cell to existing table row, jQuery 2011-10-24

    I'm trying to add values to a table using jQuery - unfortunately, I don't know how to get jQuery to add table cells to an existing row. For example: $("<td><a href='#'>" + key + "</a></td>").click(function(e) { e.preventDefaul

  • How to Add Tables to RichTextBoxes in Visual Basic 2010 2012-02-29

    How do I add tables to a RichTextBox in VB.NET 2010? I've tried adding the tables by using RTF codes, but I can't get that to work. And there is nothing like richTextBox1.AddTable() which would make things very simple. At least, if there is, I haven'

  • zebra table with ajax call 2012-04-06

    I'm adding record to table with ajax button. I want to use zebra table. I have a jquery function for zebra table. <script type="text/javascript"> $(function() { $("table tr:nth-child(even)").addClass("zebraTable"); }); </script> CSS: .zeb

  • After use jQuery add table row, jquery numeric function no more working 2012-04-15

    I use the following codes to add table row after a click, but after the row added, numeric function no more work. What is it wrong? Numeric function is a plugin to allows only valid numeric to be entered into input boxes. Here is the jQuery code var

  • Which Is the best way to show data on a table using Ajax and JQuery On ruby on rails? 2013-07-11

    Hi everyone I'm trying to display data inside of a table using AJAX and JQuery, as you can see in my code , I used a partial form to retrieve data (this work great) and then when the save button is clicked , the data is displayed without refresh the

  • ASP MVC Populate drop down list on jQuery add table row 2010-04-22

    I have a page with several drop down lists that all have the same contents. The page starts out with only three ddls, but more need to be added based on user input. There is also other information associated with the drop down lists that is all in a

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 3.557 (s). 13 q(s)