Architecture for single page application (JavaScript)

前端 未结 7 1974
旧时难觅i
旧时难觅i 2020-12-15 10:27

I wanted to understand the overall architecture for designing single page application (mainly through JavaScript)

Let\'s say I have a login page (Usernam/Password) a

7条回答
  •  醉梦人生
    2020-12-15 11:02

    This is such a broad question that entire books could be written to answer it in detail.

    Basically what you need to do is to use AJAX instead of page reloads. You still need to connect to the server to authenticate users but instead of reloading the entire page every time you do it, you need to make an AJAX call to your server and depending on whether the login was successful or not change some parts of the content on the page (like changing the Login button to a "Logged in as user xxx" message etc.).

提交回复
热议问题