I want to include a custom JavaScript file in a module using the following code.
function profile2_form_user_register_form_alter(&$form, &$form_state) {
drupal_add_js('http://localhost/prf2.js', 'external');
}
I then add scripts[] = js/prf2.js
in the .info file, but it throws this error.
Warning: file_get_contents(js/prf2.js): failed to open stream: No such file or directory in drupal_build_js_cache()
);
. If you don't understand it, you need to be more precise about what you need clarified.'type' => 'external'