2

I am working on a module for Drupal 7. I am using some of the jQuery UI modules which are included.

my natural way to include these is to use drupal_add_js() and drupal_add_css() with the relevant files. However this feels a little wrong. Is there an official (or better) way to include these libraries, either from Drupal or jQuery.

I tend to find the Drupal/jQuery interface very powerful but frustratingly sparse on documentation.

2 Answers 2

6

Found it! drupal_add_library() does precicely what I wanted, also looks like there are a few other library hooks.

Sorry for answering my own question.

Sign up to request clarification or add additional context in comments.

Comments

0

Even though your question was in the context of drupal, I found this which I though of putting as my answer:

http://encosia.com/3-reasons-why-you-should-let-google-host-jquery-for-you/

It has a nice explanation on why google hosting is recommended. And it serves all the purposes. Might be helpful for others who come to this page. :)

Comments

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.