Jquery无刷新上传单个文件
function ajax_photo(photo_type){
$(document).on('change','#sitephoto',function(){
var formData = new FormData();
formData.append("myfile", document.getElementById('sitephoto').files[0]);
formData.append('photo_type',photo_type);
$.ajax({
url: "/sitef/sitebase/savephoto",
type: "post",
dataType:'json',
data: formData,
contentType: false,
processData:false,
async:false,
success: function (msg) {
window.location.href = '/sitef/sitebase/editphoto';
},
});
})
}