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