IFRAME cross-domain resolution, end version (Xiao Zhang. NET original) [excerpt from Western Digital]

Source: Internet
Author: User

Before encountering such problems are depressed, MS why developed such a bird ie, let these people have to follow him to go, later thought, also, for security period, or to add restrictions, otherwise, others can casually change your Web content, and so on ...
OK, the rest of the nonsense is not said, look at the bottom of it:
Remember to refer to the domain name as a domain name, not www or any other, for example: shagndu8.com and cannot point to www.shangdu8.com


1. Please add the following code to the parent page:
1<script language= "VBScript" >
2 Document.domain = "shangdu8.com"
3</script>

2, please add the following code on the IFRAME page to be set (this page can be placed on any server, can not be shagndu8.com server, such as: http://www.cnblogs.com/;

1<script language= "VBScript" >
2 Document.domain = "shangdu8.com"
3</script>

In this way, ie was cheated, fooled, haha, he thinks is in the same domain, IFRAME can let the iframe adaptive height or assignment or other operation of the parent frame action.


Note: This code is small, but can solve the big problem, I have tested, please rest assured use, if you want to set the IFRAME content in someone else's server, so want to complete this operation, haha, to change the content of the Web page, plus the above code can be.

If there is any problem in use, you can contact me
Email:jzeb#163.com
qq:4803234

Copyright statement: This site articles are from the network, if there is infringement, please contact 028-86262244-215, we received immediately after deletion, thank you!
Special Note: All reproduced in this site is not representative of the views of the site, the site provides photographic photographs, illustrations, design works, if required to use, please contact the original author, the copyright belongs to the original author.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.