A
A
Alexander Andreev2018-01-30 16:27:06
Drupal
Alexander Andreev, 2018-01-30 16:27:06

Why is the drupal module connected before jQuery?

There is such a module clientside_validation in one of the scripts of the module, namely clientside_validation_html5.js, there is this code:

(/** @lends Drupal */function ($) {
  "use strict";

/*тут несколько функций для валидации*/

})(jQuery);

when opening the page, it throws the error Uncaught ReferenceError: jQuery is not defined at with an indication of the line })(jQuery); at the end of the clientside_validation_html5.js file. Moreover, if further in the console we refer to some DOM element, for example: everything works, the element is located, jQuery works out. I think that when it comes to the clientside_validation_html5.js file, jQuery itself is not included yet. I don’t understand how to win, I didn’t work with drupal before. Simply deleting, renaming the clientside_validation_html5.js file or the folder in which it is located does not work. drupal_build_js_cache() somehow finds it and gives a php error that the clientside_validation_html5.js file was not found.
jQuery('.main_menu');

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question