How do I load an HTML page in a
using JavaScript?

后端 未结 15 1945
醉话见心
醉话见心 2020-11-22 08:29

I want home.html to load in

15条回答
  •  攒了一身酷
    2020-11-22 09:15

    try

    async function load_home(){
      content.innerHTML = await (await fetch('home.html')).text();
    }
    

    async function load_home() {
      let url = 'https://kamil-kielczewski.github.io/fractals/mandelbulb.html'
    
      content.innerHTML = await (await fetch(url)).text();
    }
    
    

提交回复
热议问题