Thursday, May 23, 2024
73
rated 0 times [  76] [ 3]  / answers: 1 / hits: 18704  / 11 Years ago, wed, march 6, 2013, 12:00:00

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) and on successful authentication, I am shown the homepage. Now both the login and homepage screens should actually be part of a single page.



How can I design such kind of page?


More From » design-patterns

 Answers
20

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.).


[#79797] Tuesday, March 5, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
monicag

Total Points: 651
Total Questions: 106
Total Answers: 104

Location: Grenada
Member since Sun, Dec 20, 2020
3 Years ago
;