Zachary Forrest
Zachary Forrest

Reputation: 171

Unused variable when using jQuery UI API

When using the jQuery UI API, I run into the "Unused variable" problem when running my plugin through jsLint.

Example:

select: function( event, ui ) {
    $.cookie( opts.cookieName + "_" + that.index(), ui.index );
}

In this case, I only need the ui.index, but event is unused. But the API requires me to pass both parameters.

Is there a work around to this or am I just missing something?

Upvotes: 1

Views: 232

Answers (1)

Hogan
Hogan

Reputation: 70513

This is normal. It is often the case the event object is not used when responding to UI events

Upvotes: 1

Related Questions