I've made a cost calculator script and want to use it on my Drupal 7 site.
I heard to use drupal_add_js
, but I don't know in what context.
I've made a cost calculator script and want to use it on my Drupal 7 site. I heard to use |
||||
|
A better approach would be to get the path from Drupal, and you have to put the code in the form function;
Also add your javascript between the code below
|
|||||
|
if your script is saved as .js you can add it like that in html.tpl.php:
more info here OR
in your block or node body (make sure that you select format that does not filter JavaScript i.e. "PHP code") |
|||||||||||
|
Use function in tempale.php Add JS file in block -
Add JS file in page or node -
|
||||
|