Is client-side UI rendering via Javascript a good idea?

前端 未结 10 1524
挽巷
挽巷 2021-01-30 18:28

The \"classic\" approach to web development has been for some time a thin client and a thick server: the server generates HTML and spits it out for the browser to render only. B

10条回答
  •  醉梦人生
    2021-01-30 18:40

    I like to implement a hybrid approach. When a page is first requested, it should be populated with as much information as you can infer from the URL/Querystring/Post. And then any subsequent state changes can be queried for and updated using Ajax.

    A lot of people tend to take the approach of simply loading the page, and then letting the javascript/ajax do the work of loading. This results in the client waiting for the page to load, and then the client waiting for the data to load.

    Much better to just let the server do that initial data load and populate all the UI elements.

提交回复
热议问题