diff --git a/includes/common.inc b/includes/common.inc --- a/includes/common.inc +++ b/includes/common.inc @@ -4207,6 +4207,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS switch ($item['type']) { case 'setting': $js_element = $element; + $js_element['#attributes'] = !empty($item['attributes']) ? $item['attributes'] : array(); $js_element['#value_prefix'] = $embed_prefix; $js_element['#value'] = 'jQuery.extend(Drupal.settings, ' . drupal_json_encode(drupal_array_merge_deep_array($item['data'])) . ");"; $js_element['#value_suffix'] = $embed_suffix; @@ -4215,6 +4219,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS case 'inline': $js_element = $element; + $js_element['#attributes'] = !empty($item['attributes']) ? $item['attributes'] : array(); if ($item['defer']) { $js_element['#attributes']['defer'] = 'defer'; } @@ -4226,6 +4234,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS case 'file': $js_element = $element; + $js_element['#attributes'] = !empty($item['attributes']) ? $item['attributes'] : array(); if (!$item['preprocess'] || !$preprocess_js) { if ($item['defer']) { $js_element['#attributes']['defer'] = 'defer';