IFRAME Cross domain resolution, final version (Xiao Zhang.) NET original)

Source: Internet
Author: User
Solution | original

Before encountered such a problem is very depressed, MS why developed such a bird ie, let these people have to follow him, and then think, also, in order to safety period, or to add restrictions, otherwise, others can casually change your Web page content, and so on ...
Well, the rest of the nonsense do not say, look at the bottom of the bar:
Remember to refer to the domain name as the domain name, not the WWW or any other, example: shagndu8.com and cannot point to www.shangdu8.com


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

2, please add the following code on the IFRAME page you want to set (this page can be placed on any server, can not be shagndu8.com on the 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 thought is under the same domain, the IFRAME can allow 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 that use, if you want to set the IFRAME content in someone else's server, then want to complete this operation, haha, to change the content of the Web page, plus the above code can be.

If you have any problems in use, you can contact me
Email:jzeb#163.com
qq:4803234



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.