Here is my question:
- The project's base URL is :
- The test page URL is :, and on this page, I have included a JavaScript file called datatable.packer.js using the following code:
<script type="text/javascript" th:src="@{/resources/js/datatable.packer.js}"></script>
In the mentioned datatable.packer.js file, there is an AJAX call with the URL "/api/test", as defined below:
var url="/api/test";
- However, when accessing the page, the AJAX call URL gets parsed to "" instead of the expected URL "". Even if the URL definition is changed to "api/test", it will parse to "" ...
Any suggestions for solving this issue? How can I correctly use URLs in JavaScript code? Thank you very much for your assistance.