1

I am writing a module that does ajax calls through the uses of javascript (not the Drupal ajax engine) to its Drupal installation, which in my case is {host}/drupal7.

My Ajax call should call "{host}/drupal7/notifications/get" from any page. Yet when I do my ajax call from javascript it calls "{host}/notifications/get" now this seems like an easy fix. Yet I can't think of a way to compose the right URL in a way that it will work in any installation.

Can anyone point me in the right direction?

1 Answer 1

4

You should use Drupal.settings.basePath in your Javascript.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.