jQuery :ajaxfileupload+Struts2 文件上传,报错data undefined
jquery吧
全部回复
仅看楼主
level 1
wait_执念 楼主
Error: Permission denied to access property "document"
Resource interpreted as Document but transferred with MIME type application/json
SecurityError: Blocked a frame with origin "http://localhost:8080" from accessing a cross - origin frame.
这些都是些什么错啊!!!!
js:
$("#file")
.ajaxStart(function(){
ZENG.msgbox.show("正在导入,请稍后...", 6, 9000000);
})
.ajaxComplete(function(){
ZENG.msgbox.show("导入成功!", 4, 1000);
});
$.ajaxFileUpload
(
{
url:'<%=basePath%>importexcelajax.action',//用于文件上传的服务器端请求地址
type: 'POST',
secureuri:false,//一般设置为false
fileElementId:'file',//文件上传空间的id属性 <input type="file" id="file" name="file" />
dataType: 'json',//返回值类型 一般设置为json
success : function(data, status) {
alert("------"+status+":返回值:"+data);
ZENG.msgbox.hide();
selectData();
},
error: function(data, status, e) {
alert("------"+status+"错误是:"+e);
}
}
);
data 是 未定义的 求大神指导原因
2015年12月24日 07点12分 1
level 1
wait_执念 楼主
一开始会报错:SecurityError: Blocked a frame with origin "http://localhost:8080" from accessing a cross - origin frame
这是涉及跨域了吗?? 都是在同一个页面啊
2015年12月25日 08点12分 2
level 1
楼主解决了么?我也遇到这个问题了
2016年10月27日 08点10分 3
1