2

I am using D7. I am getting the above error when I created a js file with the code below and then included it in the .info file. What is wrong?

(function($) {
Drupal.behaviors.userLoginChanges = {
    attach: function(context) {
        $("#user-login-form").attr("placeholder", "Username");

    }
}
}) (jQuery);
2
  • Ignore this question: I realized the issue - In the info file I was writing scripts[all][] = filename, the same way you do it with css files. The correct syntax is scripts[] = filename. Commented Jul 25, 2013 at 14:31
  • 3
    No harm in putting that as an answer, could help someone in the future :)
    – Clive
    Commented Jul 25, 2013 at 14:31

1 Answer 1

6

I realized the issue - In the info file I was writing scripts[all][] = filename, the same way you do it with css files. The correct syntax is scripts[] = filename.

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.