When developing a website in the background, we often need to click exit or timeout to automatically jump out of our current framework page. We can solve this by using many methods, next I will introduce some methods for jumping out of the framework.
Common iframe operation statements
"Window. location. href" and "location. href" indicate the current page Jump.
"Parent. location. href" is the previous page Jump
"Top. location. href" is the outermost page Jump
Transition from the Framework page to the parent framework through javascript
Parent. location. href = "index. asp ";
Or
Top. location. href = "index. asp ";
Example
1. jump out of the framework and go to the parent page.
Jsp:
| The Code is as follows: |
Copy code |
<Script language = "javascript">
Window. parent. frames. location. href = ".../welcome. en"
</Script> |
Java:
PrintWriter out = response. getWriter ();
Out. write ("<script type = 'text/javascript '> window. parent. frames. location. href = '.. /welcome. en '; </script> ");
Return;
2. jump from a framework to the framework named name = "main.
| The Code is as follows: |
Copy code |
<Script language = "javascript">
Var key = document. getElementById ("#"). value;
Window. parent. main. location. href = "welcome. en? Key = "+ key;
</Script> |
3. ContentList iframe name of the current page
| The Code is as follows: |
Copy code |
| Window. ContentList. location. href = '../welcome. en '; |