0

My stated goal is to re-write an application without using jQuery.

When I load a page with jQuery all is well

$btn_notes.addEventListener('click', () => {
    console.log ("Load Notes")
    $('div.content').load ("/notes/notes.html");
})

however, when I try to do the same with raw javascript, scripts are not loaded

$btn_notes.addEventListener('click', () => {
    console.log ("Load Notes")
    fetch("/notes/notes.html")
        .then((response) => response.text())
        .then((html) => {
            console.log (html)
            $div_content.innerHTML=html
        });

})

Here is the file I am trying to load

<h1>Notes page Goes Here</h1>
<script src = '/notes/notes.js'></script>

Thanks

Dave Davis
  • 584
  • 1
  • 4
  • 14

0 Answers0