mozilla

Revision 66567 of Using nsISimpleEnumerator

  • Revision slug: Using_nsISimpleEnumerator
  • Revision title: Using nsISimpleEnumerator
  • Revision id: 66567
  • Created:
  • Creator: Yanmorin
  • Is current revision? No
  • Comment New page: == Using nsISimpleEnumerator == * <stringbundle>.strings var enumerator = document.getElementById('aStringBundleID').strings; var s = '' while (enumerator.hasMoreElements()) { var p...

Revision Content

Using nsISimpleEnumerator

  • <stringbundle>.strings
var enumerator = document.getElementById('aStringBundleID').strings;
var s = 
while (enumerator.hasMoreElements()) {
  var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIPropertyElement);
  s += property.key + ' = ' property.value + ';\n';
}
alert(s);

Links

Revision Source

<h3 name="Using_nsISimpleEnumerator"> Using nsISimpleEnumerator </h3>
<ul><li> &lt;stringbundle&gt;.strings
</li></ul>
<pre class="eval">var enumerator = document.getElementById('aStringBundleID').strings;
var s = 
while (enumerator.hasMoreElements()) {
  var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIPropertyElement);
  s += property.key + ' = ' property.value + ';\n';
}
alert(s);
</pre>
<h3 name="Links"> Links </h3>
<ul><li> Code based on <a href="en/Using_nsIPasswordManager">Using_nsIPasswordManager</a>
</li><li> <a class="external" href="http://www.xulplanet.com/references/xpcomref/ifaces/nsISimpleEnumerator.html">nsISimpleEnumerator</a>
</li><li> <a href="en/XUL/Property/strings">XUL:Property:strings</a>
</li></ul>
Revert to this revision