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
  • 10,126
  • 19
  • 78
  • 130

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
  • 143,282
  • 16
  • 168
  • 197