2

I am using Dreamweaver for jQuery coding and it automatically completes the initial jquery selection as follows:

$(document).ready(function(e) {

});

What does the "e" mean in the function definition and what is the official documentation of this parameter? A link would be helpful to official documentation.

Robert Rocha
  • 9,510
  • 18
  • 69
  • 121

1 Answers1

6

In your case e refers to jQuery object itself and is used for preventing conflict with other libraries that use $. The first parameter of ready handler refers to the jQuery object. In this case using e as a reference to jQuery is not a good decision and if DreamWeaver wrongfully chooses/passes e, you should change it yourself.

jQuery(document).ready(function($) {
   $('query').foo();
});

Reference.

But generally e is used as an alias for event object in other cases.

$('element').on('event', function(e) {
   var eventObject = e;
}); 
Ram
  • 140,563
  • 16
  • 160
  • 190