if ($formName == 'CRM_Contribute_Form_Contribution_Confirm' && $form->_id == 1) {
CRM_Core_Resources::singleton()->addScriptFile(drupal_get_path('module','custom_water') .'/',
'custom_water.js');
}
When I use the above code as mentioned in the link https://wiki.civicrm.org/confluence/display/CRMDOC43/Resource+Reference#ResourceReference-Introduction
Add a Javascript file PHP CRM_Core_Resources::singleton()->addScriptFile('com.example.foo', 'bar.js');
I get an error : Fatal error: Class 'CRM_Core_Resources' not found in
I am using drupal 7 with CiviCRM