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

82
Views
JavaScript Getting 403 Error Message while using Promises

I am new to javascript promises and I want to load the content of a file into a specific element but I get a 403 Forbidden error. Any idea how to get access to the LOCAL file that I am trying to load?

function openFile (page) {
        $('#load').load(page);
    }

    function getFile (callback) {
        let req = new XMLHttpRequest();
        req.open('GET', "/includes/addons/load.html");
        req.onload = function() {
            if (req.status == 200) {
                callback(this.responseText);
            } else {
                callback("Error: " + req.status);
            }
        }
        req.send();
    }
    getFile(openFile);
<button onclick="getFile(openFile)" >LOAD</button>
<div id="load"></div>

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!