javascript - element.dispatchEvent is not a function - Stack Overflow

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

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؟

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؟

Share Improve this question edited Feb 5, 2012 at 19:13 Highland Mark 1,0101 gold badge7 silver badges12 bronze badges asked Feb 5, 2012 at 17:20 MostafaMostafa 391 gold badge2 silver badges5 bronze badges 1
  • 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 Commented Feb 5, 2012 at 17:22
Add a ment  | 

1 Answer 1

Reset to default 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745137308a4613264.html

相关推荐

  • javascript - element.dispatchEvent is not a function - Stack Overflow

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

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信