Skip to content Skip to sidebar Skip to footer

Jquery Event Handler Not Working When Calling From Page

I have written an event to save the data in a widget.js file & the handler is on the page. There is no error or exception is coming but the handler is not getting called. Pleas

Solution 1:

Looks like event delegation is not working fine with global events

$('#discussionwidget').on("sendMessage", sendMessageHandler);

Demo: Fiddle

Solution 2:

I can see two possible problems:

  1. Your widget has class discussionwidget but you are binding with id discussionwidget.
  2. You are creating the widget dynamically with javascript? May be the event is being bound before the widget is created.

Try to fix both.

Post a Comment for "Jquery Event Handler Not Working When Calling From Page"