FF extension: a popup with dynamic menuitems, with each menu item having another popup

Posted by encryptor on Stack Overflow See other posts from Stack Overflow or by encryptor
Published on 2010-05-06T11:32:15Z Indexed on 2010/05/06 11:38 UTC
Read the original article Hit count: 545

Filed under:
|
|
|
|

I am building an extension that has a popup whose elements are constructed by a function call everytime the mouse hovers over the popup option. I am able to achieve this. Now I need to have a popup for each of the menu item (inside the original popup) which is not dynamic though. I have this code, but it does not work:

var myMenuPopup = document.getElementById("file-popup4");

for (var m=0; m

var newItem = document.createElement("menupopup");

    newItem.setAttribute("label", publicdisplayname[m]);

    newItem.setAttribute("id", "public" + m);

   var new1 = document.createElement("menuitem");
   new1.setAttribute("label","Home");
    new1.setAttribute("id", "publichome" + m);
   newItem.onclick = function(){
    }

newItem.appendChild(new1); myMenuPopup.appendChild(newItem);

but this doesnt work. Can someone please help me out with whats the problem

© Stack Overflow or respective owner

Related posts about firefox

Related posts about extension