2

I wrote a plugin , but whene Active ,disable Editor and in firebug Mozila below error Is shown

element.dispatchEvent is not a function   prototype.js:5457

and line 5457 prototype.js
  if (document.createEvent)
  5457:  element.dispatchEvent(event);
  else
  element.fireEvent(event.eventType, event);

  return Event.extend(event);
  }

but plugin work very good but disable Editor. What is the cause؟

Highland Mark
  • 1,002
  • 1
  • 7
  • 12
Mostafa
  • 39
  • 1
  • 2
  • 5
  • 7
    Your title says **`attachEvent`** is not a function; your text says **`dispatchEvent`** is not a function. Which is the real error? – T.J. Crowder Feb 05 '12 at 17:22

1 Answers1

2

Its cause the variable element has no function dispatchEvent. So you should check that element in this case is the one you expect, I doubt it. Probably you pass null/undefined or any other object but not a DOM element to this function.

Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297