0
我正在使用jQuery表单插件通过ajax上传文件。我测试过脚本,它可以在除IE之外的所有浏览器上运行。似乎在IE中什么也没有发生(事件& ...)。我工作了几个小时,仍然没有运气。jQuery表单插件在IE中不起作用
PHP:
echo $this->input->post('name');//this is a debuging statement which shows the data sent by client
JS:
$("input[type=file]").on('change',function(){
$(this).parents('.fileinput-wrapper').find('.fileinput-preview').css('background','url(http://localhost/project/assets/images/ajax-loader.GIF) no-repeat center center');
var selectedElement = this;
var name = $(this).attr('name').toString();
$('#upload').ajaxSubmit({
//dataType:'json',
data: {name:name},
success: function(data) {
$(selectedElement).parents('.fileinput-wrapper').find('.fileinput-preview').css('background',"url('http://localhost/project/assets/images/loading.png') no-repeat center center");
return false;
},
error : function(xhr) {
alert(xhr.responseText);
return false;
}
});
});
我该怎么办? (感谢您的帮助。)
一个什么样的问题?不介意我的话
:以下内容添加到您的JavaScript ...我对IE的评论:(, –
控制台中的任何错误?所有版本的IE? – charlietfl
@charlietfl,不,我认为它不会发送数据到服务器,因为我的日志文件不显示任何活动时使用IE – Ramin