To do this, you need to use the tag below in the meta tag
<head>
<base href="{{your base url_here}}">
</head>
After that, you need to write a path relative to this base url.
Example
<head>
<base href="http://localhost:8000/timer/check/">
</head>
If the full url http://localhost:8000/timer/check/test.php. Now you can write about the base url 'test.php'in the ajax call.
: https://jsfiddle.net/ptLzs7m5/1/