I'm trying to do a plugin for firefox in XUL language. So I got informations in json, I parsed them and I can use the title in javascript. But I would use it in XUL language.
For exemple, in html you can write : <a href="javascript: function()"> link </a>
;
So I need to list each title in a menuitem label,
but I don't want to hardcode it like that <menuitem label="toto"/>
I would like recup the string of my javascript's function and do something like that :
"<menuitem label="javascript:function();"/>"
I didn't find anything in internet, so I hope I had good explain my problem and I hope someone could answer it. Thank you.
ok thanks for your answer but I don't really know how inject a new element with javascript in a toolbar, by exemple :
> <button type="menu" label="View">
> <menupopup id="pblist">
> <menuitem label="toto"/> </menupopup> </button>
so there I create a button view in my toolbar with a drop-down list toto and I would add a new dynamic label in my list, something like that but i don't know how do that :
> <script>
> var list = document.createElement("menupopup");
> document.body.appendChild(list);
> menu.appendChild('<menuitem label="titi" />'); </script
vut it doesn't work ... Thanks for your help :)