Home > Web Front-end > JS Tutorial > How to use JS location.href to jump out of the frame and open a new page_javascript skills

How to use JS location.href to jump out of the frame and open a new page_javascript skills

WBOY
Release: 2016-05-16 16:37:06
Original
1232 people have browsed it

I encountered a problem today. In the frame, when the login is judged to be invalid, I need to return to the login page, but the login page is opened within the frame. I want it to open directly out of the frame (this is not a new window), and finally I found a method online and share it with everyone:

echo "";

The original content is as above. If you want it to jump out of the frame and open the login page, you need to use the following method:

echo " ";

In fact, just add a window.top before the jump link. If you are opening a new window, you can use js's window.open("url","open method"); to open the new window.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template