input file change事件調用屢次(解決只執行一次)

$('#upload').replaceWith('<input id="upload" type="file" name="excelFile"/>');
$('#upload').off('change').on('change', function() {//上傳
  loadingViewP = layer.load(1, {shade: 0.4});
  $('#uploadform').ajaxSubmit(options, function(data){});
  return false;
});ajax

每一次調用成功以後,替換input file,而後從新綁定change事件excel

相關文章
相關標籤/搜索