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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danylevskyi’s picture

Status: Active » Needs review
FileSize
5.71 KB
Mile23’s picture

FileSize
5.14 KB
1.63 KB

Nice catch, thanks.

Added some newlines, removed the ajaxy.js file.

Mile23’s picture

Status: Needs review » Fixed

  • Commit bc26eb6 on 7.x-1.x authored by danylevskyi, committed by Mile23:
    Issue #2278345 by Mile23, danylevskyi: Fixed Attaching JavaScript with...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.