I have an HTML file that contains breadcrumb links and a Javascript file that fires AJAX calls.
The breadcrumb links are relative to the HTML page. The AJAX calls are relative to the webapp context-path.
So for example, if the current HTML page is http://host.com/context_path/companies/5/user/10/index.html (where "5" and "10" are arbitrary IDs I don't know ahead of time):
- I need to generate breadcrumb links to http://host.com/context_path/companies/5/
- I need to fire AJAX calls to http://host.com/context_path/
If I set <base href="http://host.com/context_path/">
then the AJAX calls work fine, but I have no way of resolving the breadcrumb links relative to the HTML page.
Is there any way for me to implement this using client-side relative links? Or am I forced to resolve the links on the server side?