<script> $('#post_project').click(function () { // 异步提交需先保存富文本 tinyMCE.triggerSave();
let formData = new FormData($('#project_form')[0]); $.ajax({ url: '{{ url_for('mall.post_project') }}', type: 'POST', data: formData, async: false, cache: false, contentType: false, processData: false, success: function (result) {if (result.code === 200) { // 弹出模态框 $('#success-modal').modal() } if (result.code === 400) { alert(result.msg) } }, }) }); </script>
参考:https://www.it1352.com/1812271.html