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

80
Views
React always returns index.html as response

I'm trying to set up a datatable in my react app and I'd like to do the following

Here's how the documentation for the datatable is doing it:

<script src="plugins/table/datatable/datatables.js"></script>
<script>
        $('#dt').DataTable({ 
            "stripeClasses": [],
            "pageLength": 7 
        });
    </script>

I tried doing it in react via

import ../plugins/table/datatable/datatables.js"

I also used the method, where you create a script element and append in to the document.body, but both methods seem to return the index.html of my app.

I've read that it's due to React's way of handling requests - I've done an API and I can successfully hit it, however I'm not familiar how to import local files sucessfully. I've also tried importing the files inside the index.html file, but the result is still the same.

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!