File upload CKEditor 4.3.4-未评估响应脚本
我正在努力使上传成为可能的CKEditor。我在我的配置中添加了上载URL:File upload CKEditor 4.3.4-未评估响应脚本,file-upload,coldfusion,ckeditor,File Upload,Coldfusion,Ckeditor,我正在努力使上传成为可能的CKEditor。我在我的配置中添加了上载URL: config.filebrowserUploadUrl = cfData.jsService+'?method=uploadImage'; 在我的后端,我使用Coldfusion上载图像,并创建返回脚本: <cffunction name="uploadImage" access="remote" output="false" returntype="string" returnformat="plain"&g
config.filebrowserUploadUrl = cfData.jsService+'?method=uploadImage';
在我的后端,我使用Coldfusion上载图像,并创建返回脚本:
<cffunction name="uploadImage" access="remote" output="false" returntype="string" returnformat="plain">
<cfargument name="upload" required="true">
<cfargument name="CKEditorFuncNum" type="numeric" requited="false">
... // image upload logic
<cfreturn "<script type=""text/javascript"">window.parent.CKEDITOR.tools.callFunction("& arguments.CKEditorFuncNum &", '[dynamic-image-url]', '');</script>">
</cffunction>
... // 图像上传逻辑
Chrome中的响应选项卡显示以下内容:
<script type="text/javascript">window.parent.CKEDITOR.tools.callFunction(1, '[dynamic-image-url]', '');</script>
window.parent.CKEDITOR.tools.callFunction(1,“[dynamic image url]”,”;
一切似乎都进行得很顺利,但随后代码在DOM中以字符串形式打印,而不是以HTML形式打印:
我做错什么了吗?我知道它不是这个版本,因为CKFinder也使用4.3.4,并且它适用于他们()
注意:当我通过在控制台中运行callFunction来评估callFunction时,图像显示在图像弹出窗口中 刚打完这个问题就找到了,有点小错误。。。我给出了错误的
内容类型
标题(文本/普通
)
在CF中修复该问题相当容易:
cfcontent type="text/html">