I was trying to implement the following code:
var action = function (e) {
if (!e) {
var e = window.event;
}
e.cancelBubble = true;
i
In the function, actually e has been defined as argument. so when you define some variable same as arguments, it will complains.
Using a named argument creates a locally scoped variable (which is what var
does). Since you have an argument e
and you use var e
you are trying to create the variable twice.
Remove the var
from where you use e
the third time time.
var event = function (e) { // First time
if (!e) { // Second time
e = window.event; // Third time