PHP vs JavaScript For Dynamic HTML Pages

后端 未结 6 715
南方客
南方客 2020-12-13 10:15

Typically when I put together dynamically generated HTML markup, I\'ve been using PHP to store the information and then looping through that to create elements on the page.

6条回答
  •  醉话见心
    2020-12-13 10:32

    It's not an either one or the other type of situation; generally you will need to do both.

    Doing it client side will probably be slower, as the server still needs to figure out all the data but the client needs to render it; this will involve multiple requests (most likely) and DOM manipulation is slow (especially on older browsers).

提交回复
热议问题