Customizing PHP AJAX Pages

I created a PHP AJAX pagination that works with an HTML table. I have a quick question about the AJAX GET answer. Currently, my pagination script returns the entire HTML table with every GET response, and then empties the DIV that contains the html table, and then puts the new HTML table in the DIV. My question is: is it better to return data in JSON or XML format and then build the table in JavaScript?

+3
source share
4 answers

I would definitely create a table in javascript, it is scalability and just a good practice for your entire site. For example, think of mobile clients where every byte is precious.

json, , html-. :)

+3

-, , . (JSON XML) , XML.

+2

, - , . , - javascript, . :)

+2

, , PEAR Pager - http://pear.php.net/package/Pager.

, -, , , .

0

Source: https://habr.com/ru/post/1778813/


All Articles