extjs form.submit 阻止了带有原点的帧



在ExtJs中,我正在通过form.submit上传文件。

        if (field.up('form').getForm().isValid()) {
        field.up('form').getForm().submit({
            url: ExtApplication4.util.GlobalVar.urlUploadPositionSheet,
            waitMsg: 'Uploading your file...',
            headers : {
                'Content-Type' : 'text/html'
            },

错误信息

{success:false,message:"Blocked a frame with origin "http://localhost:57007" from accessing a cross-origin frame."}

我看到有很多关于这个的帖子...Extjs fileuplaod - 跨源框架

但即使我遵循它,我仍然无法返回成功。

有谁知道我会把

response.write('document.domain = "' + params.__domain + '";'); response.write(JSON.stringify({msg: 'Welcome ' + params.name})); response.end(''); 

解决方案中提到了这一点。 如果这甚至是解决方案。

我也遇到了这个,结果是:此解决方案仅在两个域中有效

1.属于同一个父域,如 http://static.a.com 和 http://service.a.com

2.具有相同的主机名,只是端口不同,例如 http://localhost:81 和 http://localhost:82

最新更新