Switched to using local library but cannot get it working!
Switched to using local library but cannot get it working!
Hi
Using VS 2019
We were using the datatables for an internal site. This worked correctly.
We have then been asked to use the datatables locally. I have downloaded the datatables and buttons and I changed the above to this:
<script type="text/javascript" src="/lib/Buttons/1.7.1/js/dataTables.buttons.min.js"></script>
When I now run the site the tables aren't appearing.
When I look at developer tools I get this below.
Appreciate any guidance.
Failed to load resource: the server responded with a status of 404 (Not Found) jquery.dataTables.min.js:1
Failed to load resource: the server responded with a status of 404 (Not Found) - dataTables.buttons.min.js:1
jQuery.Deferred exception: $(...).DataTable is not a function TypeError: $(...).DataTable is not a function
at HTMLDocument.<anonymous> (https://localhost:44314/IndexManager:184:26)
at l (https://localhost:44314/IndexManager/lib/jquery/jquery.min.js:2:29375)
at c (https://localhost:44314/IndexManager/lib/jquery/jquery.min.js:2:29677) undefined
w.Deferred.exceptionHook @ jquery.min.js:2
DevTools failed to load source map: Could not load content for https://localhost:44314/IndexManager/lib/twitter-bootstrap/js/bootstrap.bundle.min.js.map: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for https://localhost:44314/IndexManager/lib/twitter-bootstrap/css/bootstrap.css.map: Connection error: net::ERR_CONNECTION_REFUSED
DevTools failed to load source map: Could not load content for https://localhost:44314/IndexManager/lib/twitter-bootstrap/css/bootstrap-grid.css.map: Connection error: net::ERR_CONNECTION_REFUSED
Answers
The errors are specific to your web server configuration. You need to verify that the server is configured to serve files from the path you are requesting, ie,
src="/lib/Buttons/1.7.1/js/dataTables.buttons.min.js"
.Kevin
Thanks Kevin
I'm just using the inbuilt IISExpress in Visual Studio. Can it be configured to do that?
It can, but you need to make sure the paths that are being served match what the browser is requesting.
Colin