Disable the iframe pop-up window to overwrite the parent window. The iframe window
The iframe function I want is not to control the parent page. If he wants to control it, which code can be added to the parent page to make it unmanageable?
If iframe contains such a statement: window. parent. location. href = "http://www.baidu.com" This will change the page of the parent page,
What can I add to the parent page to make it unable to change the parent page? Some commands are popped up in the new window, instead of overwriting the parent page!
After Baidu is put into the framework, the search will jump to the parent framework, but this tomato search has successfully put him into the framework, but I don't understand how he actually implemented it!
Define in parent window
Var location = new Object () // or var location = "".
If a jsp page is embedded in iframe, a div layer needs to be popped up in iframe, but this div cannot exceed the iframe range.
Ideas:
Define the div layer in the parent window. The pop-up div function is defined as a method popupDiv. On the iframe page, call the method of the parent window:
Window. parent. popupDiv ().
How does the iframe content pop up in the parent window?
I don't really understand what you mean. Do you want a page to be used by others in iframe? If so, you can add the following code to your page:
<Script language = "javascript" type = "text/javascript"> if (top. location! = Self. location) top. location = self. location; </script>
In this way, if the page is placed in the framework, it will automatically jump out of the framework.
If you have any questions, please check your answers.