An issue where multiple IFrame cannot find results on a page

Source: Internet
Author: User

The IFRAME is described earlier, and cross-domain requests are also introduced, which is not covered here.

Today in the actual business encountered a phenomenon, an ERP management system, used to upload pictures and iframe access to other domain names, upload images used to ajaxfileupload, and this upload image control itself has an IFRAME, This means that there are 2 iframe in a page, which causes me to upload a picture to return the results of the operation without any results, such as

Methods for foreground access calls

$.ajaxfileupload ({            url :  ' Http://*******.com/active/addimg.action ', //  needs to be linked to server address              secureuri : false,             fileElementId :  ' Imgfile ', //  the id attribute of the file selection box              cache :false,             dataType:  ' json ',//return value type   General set to json               success : function (Result,status)  {                                  }                     }) 

Background Receive and return

Result result= activeservice.addimg (Getimgfile (), Getimgfilefilename ());p rint (Result.resultjson ());

No matter how many times the call can not return the results, after the Internet query reason, only to know that in multiple IFrame, the return of the results of the Domian need to specify, and later in the return of the results written

Result result= activeservice.addimg (Getimgfile (), Getimgfilefilename ());p rint ("<script>document.domain = ' * * * * . com ';</script> ' +result.resultjson ());

The results will be displayed normally!!!

This article from "Loyalty" blog, declined reprint!

An issue where multiple IFrame cannot find results on a page

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.