FCKeditor solves the problem of cross-origin application in IFRAME.

Source: Internet
Author: User

Some days ago, when I was working on extjs + FCKeditor, I found a very tricky problem.


When IFRAME is not nested, all functions of FCKeditor are normal and the application is very convenient. However, when I cross-origin, the application pop-up forms in the toolbar of the editor cannot be opened, with a 404 error.


Page a loads page B


Page a is the application IFRAME

B page placement rendering FCKeditor


The two pages are used in different domains and normally used in one domain, but displayed normally in two different domains, the Error 404 is not found in the pop-up box for uploading images.


After painstaking research, I finally found a solution.


In the FCKeditor/Editor/JS/fckeditorcode_ie.js script file, it was a mess when it was just opened. It was really annoying to solve it.

We found that O. src = fckconfig. basepath + 'fckdialog.html 'is the form path of the pop-up tool, that is, this path is wrong.


It is a relative path, so it obtains the parent path.


Modified to: O. src = fckconfig. fullbasepath + 'fckdialog.html ';


After obtaining the path of the current editor domain, it will be OK.

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.