I call quite a number of different js functions on $(document).ready() Functions list varies depending on page and I would like to build it as I go similar way I do with including js files with drupal_add_js.

Is there a way I could add anything to $closure?

Comments

davedelong’s picture

I know that the admin_menu module adds stuff to $closure. You can check out what it's doing and replicate it.

Dave

Get great Drupal hosting at MM Hosting. (I don't work for them; I'm just a very satisfied customer)

Etanol’s picture

I had a problem with finding out how it was done in admin_menu, but luckily I remembered that all wysiwyg editors used it as well and I found exactly what I needed in fckeditor module.

For anybody else looking for this: To add js to footer (with print $closure) you use:

drupal_add_js('your java script without script html tags', 'inline', 'footer');

Works just fine.