Framework for dispatching an action for a menu item selection ?

1 posts, 0 answers
  1. RichardAD
    RichardAD avatar
    105 posts
    Member since:
    Feb 2012

    Posted 02 Apr 2012 Link to this post

    In general I guess I am asking what are people doing in the select: method.

    I would like some feedback on the following

    <ul id='myMenu'>
    <li data-handler='miItem1;'> item 1 </li>
    <li data-handler='alert("!")> item 2 </li>

    function (e) {
    var handler;
    if (handler = $(e.item).data('handler')) {
          Function (handler)();  /* construct and execute handler */

    function miItem1() {
      alert('menu Item 1');


Back to Top