开发者

How to handle the non-js environment?

开发者 https://www.devze.com 2023-04-01 00:34 出处:网络
Let say I have a web page, index, and have a button can login, when I click login, the webpage become the login page,.....

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消