CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • why is civicrm_html_head drupal_add_js not working
Pages: [1]

Author Topic: why is civicrm_html_head drupal_add_js not working  (Read 863 times)

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
why is civicrm_html_head drupal_add_js not working
September 28, 2010, 10:37:14 pm
Hello, I'm trying to add a custom JavaScript to my CiviCRM contribution page. I've tried adding the code several different ways with various paths and it never seems to call up my script.  Can anyone tell me why it's not called?  Do I need to have Drupal some how reload the civicrm.module?

I'm adding these lines to my sites/all/modules/civicrm/drupal/civicrm.module file

Code: [Select]
        // add Custom JavaScript
        drupal_add_js( base_path() . 'civicrm_custom/jqtransform.min.js' );

        // add Custom JavaScript
        drupal_add_js( 'civicrm_custom/jqtransform.min.js' );

Even if I drop a script stright in the civicrm/js folder it does not get called. Please help.

Code: [Select]
drupal_add_js( drupal_get_path('module', 'civicrm' ) . '/../js/wtf.js' );

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • why is civicrm_html_head drupal_add_js not working

This forum was archived on 2017-11-26.