By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,548 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,548 IT Pros & Developers. It's quick & easy.

Displaying AJAX Response

P: 1
I am using AJAX to call a PHP script. The PHP echo back a complete HTML table. How can I display this table as a HTML page ?
Jan 8 '15 #1
Share this Question
Share on Google+
1 Reply

P: 287
You must have a target element where you want to display the output from your ajax. like this.
Expand|Select|Wrap|Line Numbers
  1. $.ajax({
  2.             type: "post",
  3.             url: "URL",
  4.             data:{
  5.                 fielddata    :    "fielddata"
  6.             },
  7.             success: function(datafromphp)
  8.             {
  9.                 $("#elementToDisplay").html(datafromphp);
  10.             }
  11.         });
Make sure that the id or class of your element where you want to display is existing.
Jan 9 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.