I need to specify the type of script in my theme.info I add the script in my theme.info like this scripts[] = js/file.js In the head it look like this

<script type="text/javascript" src="..."></script>

but i need to change the type to


Can someone help me please

  • Khaled, Please give Correct Question Titles else you will get more down votes as people think this question is irrelevant to drupal. Sep 7, 2015 at 12:42
  • ok thans, but it's my first question so i'm not familiar with this site
    – khaled
    Sep 7, 2015 at 13:08
  • This link will guide you for adding questions on this forum. drupal.stackexchange.com/help/on-topic Sep 7, 2015 at 13:13

1 Answer 1


Drupal core adds the text/javascript as default type.

You may include the file using drupal_add_js

drupal_add_js('file.js', array('attributes' => array('id' => 'my-template', 'type' => 'application/ld+json')));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.