上传文件后尝试重定向页面 http://jsfiddle.net/adampavlov/sfuon5y6/8/
$("#upload_link.first").on('click', function(e){
e.preventDefault();
$("#upload:hidden").trigger('click');
});
/*
$("#upload_link.first").on('click', function(e){
e.preventDefault();
$("#upload:hidden").trigger('click');
},
function(){
window.location.href = "http://jsfiddle.net/";
});
*/
答案 0 :(得分:2)
您可以使用文件输入字段的on change事件
$("#upload_link.first").on('click', function(e){
e.preventDefault();
$("#upload:hidden").trigger('click');
});
$('#upload:hidden').change(function(e){
console.log(e.target.files[0])
window.location.href = "http://jsfiddle.net/";
})