Drupal Questions & Answers

Ask and answer Drupal related questions! No question too simple or complex!
runeveryday's picture
Asked by on Sun 12th Sep 2010

i put this code into template.php.but it didn’t work.when i access the page (example.com/myform)

function mytheme_preprocess_page(&$vars, $hook) { 

if (arg(0)=='myform') { 


drupal_get_path('theme', 'mytheme') .'/myform.js',  





i have cleared the cache, it still can’t work. if i put this line (scripts [] = myform.js)into the info file,it works, why?

Commenting on this Drupal Question is closed.