Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Why can't I load files that include scripts using native javascript?

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!