ServerSide (PHP) and ClientSide (JS) compromising

I have a rowset, I can generate a table (HTML) from it using PHP (server side) or I can send raw data to the client side and create the table there using JavaScript

Which one is better and the way?

+3
source share
5 answers

The server side will work faster, because you still have to iterate over the collection of rows to get the row out of it, so instead you better create a table already ...

JavaScript content rendering in anti-SEO template!

+6
source

Javascript, ( , ), - (, Google)

+6

, . , , .

, , -/-. , , , , .

, , -. ( , )

. (, , SEO ..), .

+1

Javascript , , ; , JavaScript, , , JS , script.

, , , , . , div , - , , , . 1 div / , .

, .

+1

, -, .

In this case, definitely the client side. Even if you have 1000 lines. Send them to JSON (lower frequency band), then draw the table using jQuery, but don’t display them all at once. This will kill your browser. Use paging, sorting and searching to create the best user experience. If you need to deal with hundreds or thousands of lines, use jOrder to search, sort, and swap to speed things up.

-2
source

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


All Articles