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);
  • 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. – user1015214 Jul 25 '13 at 14:31
  • 3
    No harm in putting that as an answer, could help someone in the future :) – Clive Jul 25 '13 at 14:31
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, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.