Skip to main content

To add external js in drupal 7 from hook

To use jQuery in drupal 7 custom hook.


function hook_add_html_head() {
drupal_add_js(" js file path");
}


This gives the functionality as we can use the $ sign in js file.
If we only use drupal_add_js() then we use jQuery instead of $.


To know details :- Click Here

Comments

Popular posts from this blog

Views3 Integration ( Add Db_prefix in settings.php for drupal 7 )

These instructions assume CiviCRM and Drupal are on separate databases located on the same physical host , and that the same database user has access to both the CiviCRM and Drupal databases. Before making any changes, it is  strongly  advised that you make backups of your mysql databases and settings.php file. Make sure you are logged into your Drupal site as the administrator. Visit  http://yourdomain.com/civicrm/admin/setting/uf?reset=1  Replace with the domain of your Drupal site/installation. You should see a page with output that begins with: "$databases['default']['default']['prefix']= array(" Copy everything inside this box, including the trailing ");" Open /sites/default/settings.php for editing from the root directory of the site, typically "public_html" on most servers. ( NOTE: This assumes you have a single site installation. The location of the settings file might be different depending on whether or ...