Client-side or server-side processing?

前端 未结 6 876
逝去的感伤
逝去的感伤 2021-02-05 10:22

So, I\'m new to dynamic web design (my sites have been mostly static with some PHP), and I\'m trying to learn the latest technologies in web development (which seems to be AJAX)

6条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 10:37

    I do a great deal of AJAX app development and I can tell you this from my experience. a good balance between the two is key.

    do the raw data server-side but use javascript to make any modifications that you would need to it. such as paging, column sorting, row striping, etc.

    I absolutely love doing everything in AJAX heh.. but there are some short falls to doing it using AJAX, and that's SEO. search engines do not read javascript, so for the sake of your website's page rank, I would say have all data served up server side and then formatted and made look cool client-side.

    The reason I love AJAX so much is because it drastically speeds up your APP usage by the user as it only loads the data you need to load where you need to load it, versus load the entire page every time you do something... you can do a whole bunch of stuff, such as hide/show rows/columns (we are talking about table manipulation here because you mentioned a table) and even with these show/hide actions add delete actions where when you click a delete row or button it deletes that row not only visually but in the database all done via AJAX calls to server-side code.

    in short.

    raw data: server-side sending to the client the raw data in html layout (tables for table structured data, however I do everything else in divs and other flexible html tags, only do tables for column/row style data)

    data formatting: client-side which also includes any means of interacting with the data. adding to it, deleting from it, sorting it differently etc. This achieves two things. SEO, and User Experience (UX).

提交回复
热议问题