I have a javascript array of strings and I want to display below this in an XUL panel one below the other. What is the best way to do this?
Asked
Active
Viewed 106 times
2 Answers
1
It's best to create <description>
elements for all the strings using the usual DOM methods:
var strings = ["foo", "bar"];
var container = document.getElementById("panel");
for (var i = 0; i < strings.length; i++)
{
var description = document.createElement("description");
description.textContent = strings[i];
container.appendChild(description);
}

Wladimir Palant
- 56,865
- 12
- 98
- 126
0
You can do it many ways in XUL for example XUL tree, list, grids etc...
https://developer.mozilla.org/en/XUL/listbox http://www.xul.fr/tutorial/xul/listbox.xul https://developer.mozilla.org/en/XUL/tree#A_tree_with_several_columns https://developer.mozilla.org/en/XUL_Tutorial/Grids
Please refer the links for example code.

linguini
- 1,939
- 5
- 49
- 79