add JavaScript to a page in drupal 7

1

I have a problem, I have to add a script to a page in drupal 7, but when I add the script in the content of the page it is not saved, how do I add a javascript to a drupal 7 page? Thanks in advance.

attached image of how to add the script.

    
asked by Felipe Andres 22.03.2018 в 22:15
source

2 answers

0

In the format select "FULL HTML", or you can install this Drupal module javascript_libraries

link

    
answered by 19.05.2018 в 03:07
0

You can create a .js file with the content of your script and then add it like this:

drupal_add_js('archivo.js');
    
answered by 01.06.2018 в 20:56