{# {% for u in teacher_d.keys %}#} {# {% for u in teacher_d.values %}#} {% for k,u in teacher_d.items %} <input type="text" value="{{ k }}"> <input type="text" value="{{ u }}"> {% endfor %} user_dict = {…
var form=document.getElementById("formId"); var formData=new FormData(form); var oReq = new XMLHttpRequest(); oReq.onreadystatechange=function(){ if(oReq.readyState==4){ if(oReq.status==200){ var json=JSON.parse(oReq.responseText); console.log(j…
function onSubmit (data) { //获取文本 var callingContent = $('#callingContent').val() // 获取文件 var files = $("#selected_files")[0].files[0]; //把文本和文件都存入formData,再发送ajax上传 var formData = new FormData(); formData.append('file', files); formData.append(…