0

I'm trying to link a Javascript file to my php/html table. I copied the relative path from VS code directly and think the path is correct:

<script src="lib/tablesort.js"></script>

^this is in my .php file where the html table is. The full path is "/mnt/c/xampp/htdocs/AngelsOnWheels/lib/tablesort.js"

The javascript file is simple, and prints two variables to the console:

function sortTableByColumn(table,column, asc = true){
    const dirModifier = asc ? 1 : -1;
    const tBody = table.tBodies[0];

    const rows = Array.from(tBody.querySelectorAll("tr"));
    //Sort each row
    const sortedRows = rows.sort((a, b) =>{
        console.log(a);
        console.log(b);

    });
} 

sortTableByColumn(document.querySelector("table"), 1);

When I attempt to load the page and view the output on the console, the console gives me these errors: "Source map error: Error: request failed with status 404 Resource URL: http://localhost/AngelsOnWheels/lib/bootstrap/js/bootstrap.js Source Map URL: bootstrap.js.map

Source map error: Error: request failed with status 404 Resource URL: http://localhost/AngelsOnWheels/lib/bootstrap/css/bootstrap.css Source Map URL: bootstrap.css.map"

What are these errors telling me?

ADyson
  • 57,178
  • 14
  • 51
  • 63

0 Answers0