Get iterator from Stack : Stack « Dojo toolkit « JavaScript DHTML






Get iterator from Stack

 
<html>
  <head>
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojox.collections.Stack");

      function testIt() {
        var st = new dojox.collections.Stack();
        st.push("A");
        st.push("B");
        st.push("C");
        st.push("D");
        var it = st.getIterator();
        while (!it.atEnd()) {
          alert(it.get());
        }



      }
    </script>

  </head>

  <body onLoad="testIt();">
  </body>
</html>

   
  








Dojo-toolkit.zip( 3,849 k)

Related examples in the same category

1.Push elements to stack
2.Peek element
3.Pop element out
4.Stack.contains
5.Convert stack to array