Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
js_example module has incorrect JavaScript attaching.
(function($){
$(document).ready(function(){
// Code here.
});
})(jQuery);
That is wrong way.
(function ($) {
Drupal.behaviors.example = {
attach: function (context, settings) {
// Code here.
}
};
})(jQuery);
That is right way.
I'll prepare a patch for js weights example.
Comment | File | Size | Author |
---|---|---|---|
#2 | interdiff.txt | 1.63 KB | Mile23 |
#2 | 2278345_2.patch | 5.14 KB | Mile23 |
#1 | examples-drupal_behaviors-2278345-1.patch | 5.71 KB | danylevskyi |
Comments
Comment #1
danylevskyiComment #2
Mile23Nice catch, thanks.
Added some newlines, removed the ajaxy.js file.
Comment #3
Mile23Committed! http://cgit.drupalcode.org/examples/commit/?id=bc26eb60743ce9e0bf1464104...
Thanks, danyleskyi!