Advertisement

07.12.2008 at 09:44AM PDT, ID: 23559745 | Points: 500
[x]
Attachment Details

ajax request, whrere to create the new HTML

Asked by ioustinos_sarris in PHP and Databases, Asynchronous Javascript and XML (AJAX)

Hi there,
I make an ajax request on a .php file which runs a query and gets some data (items )from the db.
Which is the best way to show this new data on a block on a page?
A. Return a json string, parse it and create the new elements one by one using some DOM functions?
B. Create an html string on php, retunr that string to javascript and simple put that (innerHTML) into a div?  Start Free Trial
 
Loading Advertisement...
 
[+][-]07.12.2008 at 09:53AM PDT, ID: 21989733

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 11:26AM PDT, ID: 21989970

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.12.2008 at 12:44PM PDT, ID: 21990170

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_2_20070628