I have an ajax task to return a form token from my controller for use in ajax pages, so that subsequent ajax requests will have a token. It looks like this in the code:
and like this in the ajax request:
This works fine, until I use it in a multilingual site. In this case, the server returns a 303 error with the suggested redirect to
and the token never gets populated.
Is there something I need to do similar to
JRoute::_() on the URL to ensure that the right URL is used and a 303 is not returned? (I did try JRoute but this didn't have any effect).