Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set to jump out of the Ifram framework after login expires

2025-04-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to set up to jump out of the Ifram frame after login expires". The editor shows you the operation process through an actual case. The method of operation is simple and fast, and it is practical. I hope this article "how to set up to jump out of the Ifram frame after login expiration" can help you solve the problem.

1. The background of the article

When we are doing background project management, we often use Ifram framework to load pages, namely:

We use iframe tags to load pages, and the src can point to different pages, so we can open more pages in one page, but we also need to control the number of pages opened by our colleagues as much as possible to avoid crashing pages caused by too much client consumption.

2. Problem description

In the last step, we have learned about the Ifram framework, which is roughly divided into menu bar, navigation bar, and main Ifram content. When our login information expires, the system will intercept the login, causing the page to jump to the login interface, as follows:

As you can see, when our login information expires, ifram loads the login interface, and when we enter the login information, we find the following:

Well, customers do not know what happened, and they must think that there is something wrong with the system, which is very bad for the user experience.

3. Solution

Above, we have learned that the page loaded by ifram will cause the login information to expire and the login interface will be loaded, which will affect the user experience. The solution is as follows:

/ / when the login expires, jump out of the ifram framework if (top.location! = self.location) {top.location = self.location}

In the JS of the login interface, we add the above code to indicate whether the URL of the current form is not equal to the URL of the parent form, and if not, the URL of the parent form is equal to the URL of the current form, so that we can successfully jump out of the Ifram framework.

This is the end of the content about "how to set up to jump out of the Ifram frame after login expires". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report