Loading ...
Sorry, an error occurred while loading the content.

error in adding menu items

Expand Messages
  • kavithapronet
    y nobody is replying???? this is 5 th time i am posting same problem please anybody reply as this is urgent issue in our company I have one Menu and i am
    Message 1 of 1 , Feb 7, 2007
    • 0 Attachment
      y nobody is replying???? this is 5 th time i am posting same problem

      please anybody reply as this is urgent issue in our company

      I have one Menu and i am trying to add and remove items from single Menu

      The menu comes up fine for first time itz showed,second time it will
      show the error as....

      uncaught exception: [Exception... "Component returned failure code:
      0x80004003 (NS_ERROR_INVALID_POINTER)
      [nsIDOMHTMLLIElement.appendChild]" nsresult: "0x80004003
      (NS_ERROR_INVALID_POINTER)" location: "JS frame ::
      http://kavitha/scripts/yui/container_core.js :: anonymous :: line
      1106" data: no]

      Sample code is,,,

      var menu = new YAHOO.widget.Menu("cmenu");
      var aItems = [
      { text: "First"},
      { text: "Third", submenu: { id: "Third", itemdata: [

      { text: "360", url: "http://360.yahoo.com" },
      { text: "Alerts", url: "http://alerts.yahoo.com" }
      ] } }];

      function showMenu(){
      //first trying to remove menu items
      if ( YAHOO.widget.MenuManager.getMenu("cmenu") !== undefined ){
      var oMenu = YAHOO.widget.MenuManager.getMenu("cmenu");
      removeAllItems(oMenu);
      }
      //rendering the menu after adding menu items
      menu.addItems( aItems);
      menu.render(document.body);
      menu.show();
      }


      The error is same in IE and FireFox.
    Your message has been successfully submitted and would be delivered to recipients shortly.