When dealing with $.ajax and encountering issues related to a path base on my website, I often find that the specified URL in JavaScript does not include the necessary path base, resulting in a route not being found. Are there effective strategies for handling path bases with $.ajax?
One approach I considered was using ajaxSetup along with beforeSend to modify the URL by adding a prefix. This would allow me to set the URL prefix globally instead of having to manually update every URL string in my codebase. However, when using beforeSend in my $.ajax call, it seems that the beforeSend function established in ajaxSetup is disregarded, making this option seem unviable.