Hi,
The following code executes in an XPCOM JS component in the context of
the "xpcom-startup" topic:
var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
.createInstance(Components.interfaces.nsIXMLHttpRequest);
req.open("GET", "chrome://foxyproxy/content/strings.xul", false);
req.send(null);
this._entities = new Array();
var e = req.responseXML.getElementsByTagName("i18n");
dump("length==" + e.length + "\n");
for (var i=0; i<e.length; i++) {
dump("i=="+i+"\n");
dump("e[i]==" + e[i] + "\n");
this._entities[e[i].getAttribute("id")] = e[i].getAttribute("value");
}
It outputs the following to stdout:
length==35
i==0
e[i]==undefined
I'm confused why e[i] == undefined? If I run this exact code in Ted's
Javascript Shell (default context, not browser.xul), it works just
fine.
Can anyone help? I'm stumped.
Thank you,
Eric Jung
_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners