Jump to: navigation, search

1,526 bytes added, 19:21, 1 December 2006
=== [ How do I create XUL elements dynamically in JavaScript?] ===
Use the following snippet of code to add a new element under an existing element:
var elem = document.getElementById(XUL_ELEMENT_ID);
var node = document.createElement(XUL_ELEMENT_NAME);
node.setAttribute(ATTRIBUTE, VALUE);
node.setAttribute(ATTRIBUTE, VALUE);
=== [ How do I access XUL elements in a sidebar from the context menu JavaScript?] ===
The sidebar's content is a separate document, so you should use document.getElementById("sidebar").contentDocument.getElementById(...)
This is something you could see using the DOMi.
See also
=== [ How can I include a .js document from inside a JavaScript document?] ===
Use the following snippet of code to reference a js file within a js file:
objScriptLoader = Components.classes[";1"].getService(Components.interfaces.mozIJSSubScriptLoader);
See for more information.
== UnAnswered Questions (UAQ) ==

Navigation menu