outerHTML からの新しいコンテンツである新しいコンテンツでページを更新することは可能ですか? ページを2秒まで更新したい、0〜2秒処理してinnerHTMLなどで新しいHTMLを取得したいという問題がありますが、outerHTMLから新しいコンテンツを取得した後。このコンテンツを outerHTML からの HTML で更新するのは困難です。
私のコード例の下:
<script>
// code blablabla to get new content. This has been fix code, and below code to start refresh page with outerHTML.
window.onload = function() {
tes();
};
function tes() {
var htmlAll = document.documentElement.outerHTML;
setTimeout(function(){howCodeRefresh()}, 2000);
function howCodeRefresh() {
// how code to refresh page and replace all content with variable htmlAll
};
};
</script>
私の質問:それは可能ですか?はいの場合、それを行う方法は?
ありがとう。