Currently, I am delving into the world of creating a Firefox extension. Although I have never ventured into extension development before and my grasp on JS/JSON/XML is limited, the ever-present Google is there to lend a hand. This block of code is designed to display every "sName" element within the JSON object:
for(var i=0; i<obj.names.length; i++)
{
var nameItem = createListItem(obj.names[i].sName);
lb.appendChild(nameItem);
}
One challenge I am facing is replacing any empty spaces in a name with an underscore.
nameItem = nameItem.replace(/ /g,"_");
Upon inserting the "var nameItem =" line, the printing of all names ceases abruptly, and
var nameItem = createListItem(obj.names[i].sName).replace(/ /g, "_");
resulted in the same undesirable outcome.