Closed likelian closed 2 years ago
这个问题解决了,不过没有用到数据库,就是用js监听ajax那个xhr对象的状态。 当状态变成load的时候,就刷新一下iframe。 https://github.com/likelian/MusicTXT/blob/main/musictxt/ponds/static/style.js
xhr.addEventListener('load', function(e) {
document.getElementById("runStatus").innerHTML = "Success!";
console.log(xhr.response);
document.getElementById("myIframe").contentWindow.location.reload();
});
xhr.addEventListener('loadstart', function(e) {
document.getElementById("runStatus").innerHTML = "Loading...";
});
xhr.addEventListener('error', function(e) {
alert('request failed for some reason, please look into the sendText()');
});
前端监听数据库