I was trying to implement the following code:
var action = function (e) {
if (!e) {
var e = window.event;
}
e.cancelBubble = true;
if (e.stopPropagation) {
e.stopPropagation();
}
container.objet.hide();
}
But jslint complains about the following:
'e' is already defined. var e = window.event;
What is the best way to fix this problem?
Using a named argument creates a locally scoped variable (which is what
vardoes). Since you have an argumenteand you usevar eyou are trying to create the variable twice.Remove the
varfrom where you useethe third time time.