Let say I have a web page, index, and have a button can login, when I click login, the webpage become the login page,..... Here is what the web look like:
[ Banner ]
[ Main ]
[ Footer ]
The site have 3 parts, Banner, Main and Footer. When user login, I change the main div to login, via an ajax call:
[ Banner ]
[ Login ]
[ Footer ]
It works great, but if the NON-JS environment, I need to render the 开发者_运维百科whole page. What should I do the best to handle it is the most common way? Thank you.
If 'NON-JS environment' means disabled or not supported javascript, use NOSCRIPT tag block. See in MDN, in MSDN
If you want this to work correctly without JS, you'll need to handle rendering without AJAX. Depending on your backend you could try to reroute to a new page containing the correct content after successful login.
精彩评论