Html:
<div>
<form enctype="multipart/form-data" action="upload/" method="POST" target="hidden_frame_apk">
<input type="file" name="file"/>
<input id="input_gameId_apk" type="hidden" name="gameId" value=""/>
<input type="hidden" name="type" value="apk"/>
<input id="updata_btn_apk" class=" btn" type="submit" value="上传文件"/>
</form>
<iframe name='hidden_frame_apk' id="hidden_frame_apk" style='display: none'></iframe>
</div>
JavaScript:
let updata_btn_apk = document.getElementById("updata_btn_apk");
updata_btn_apk.onclick=function (){
let hidden_frame = document.getElementById("hidden_frame_apk");
hidden_frame.onload = function () {
//上传结果处理;
let body = hidden_frame.contentDocument.body.innerText;
getParentPackage(gameId);
alert(body);
};
};