small help how can load the file jquery.min.js at the bottom of the page
in drupal 7.x and in 6.x

CommentFileSizeAuthor
#3 add-ui-for-move-js-to-footer-2228053-3.patch2.19 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iammeenugupta96’s picture

Below code can be used to place the javascript .js file at the bottom of the page:

In template.php file:

<?php
// Used in conjunction with https://gist.github.com/1417914
/**
* Implements hook_preprocess_html().
*/
function THEMENAME_preprocess_html(&$vars) {
$path = drupal_get_path('theme', 'THEMENAME');
drupal_add_js($path . '/js/jquery.min.js', array('scope' => 'footer', 'weight' => -1, 'preprocess' => FALSE));
}
/**
* Implements hook_process_html().
*/
function THEMENAME_process_html(&$vars) {
$vars['foooter'] = drupal_get_js('foooter');
}

Anonymous’s picture

Version: 7.x-1.0 » 7.x-3.x-dev
Assigned: Unassigned »
Category: Support request » Feature request
Status: Active » Needs work

I'll try to add some ui to the configuration form to be able to load jquery in the header or footer.

Anonymous’s picture

I have added a new option to move all js to the footer, I hope it'll be helpful). Please review.

Anonymous’s picture

Assigned: » Unassigned
Status: Needs work » Needs review

Change status of issue.

markhalliwell’s picture

Status: Needs review » Closed (won't fix)

This falls outside the scope of what this project should be doing (it's goal is to update jQuery and subsequent jQuery related code, not alter where it all shows up). For something like this, you would be better off using https://www.drupal.org/project/advagg.