나는 모듈이 있고 그 안에 내가드루팔 7 add_js 무게
if($_GET['q'] == 'workpage') {
drupal_add_js(drupal_get_path('module', 'sb_carousel').'/js/slide.js');
}
문제는 .INFO 파일에 정의되어 jqueru 위에 추가합니다입니다 함께 JS를 추가합니다. 나는 'js'파일의 맨 아래에 js를 어떻게 얻을 수 있습니까? weight
를 사용
$file = drupal_get_path('module', 'sb_carousel').'/js/slide.js';
$options = array(
'weight' => 1000, // High number to push this file to the bottom of the list
'scope' => 'footer' // This will output the JS file in the footer scope, so at the end of the document
);
drupal_add_js($file, $options);
및 scope
당신은 당신의 JS 파일을 HTML로 출력 맨 마지막 있는지 확인 할 수 있어야한다 :