making a function which accepts a list of objects and an anon function to go through them
<p>the parameters are:</p>

<p>data:    an array of objects.</p>

<p>anonFunction:   a function which has the parameters which are the same as the params an object from data.</p>

<p>goal:   </p>

<p>it will iterate through data, and fire off the anon function with new params each time.</p>

<p>Idea/Attempt:</p>

<pre><code> function special(data, executeFunction){
    var callback = function(){
       if(executeFunction){
          executeFunction();
       }
    }
    var d = JSON.parse(data);
    for( var i = 0; i &lt; d.length; i++){
       var object = d[i];
       callback(object);
    }
 }
</code></pre>

<p>Does that look about right?  The only issues i can see is that object is serialized.  So i would need to pass in only the values of the items, in the order.  Figure that might be accomplished by somehow.  Im not sure. :(</p>

<p>As you can see i have some gaps.</p>

<p>Edit:  Some sample data:</p>

<pre><code>data = [{"url": "google.com", "type":"POST"}, {"url":"yahoo.com","type":"GET"}]
</code></pre>

<p>it would be broken down an iterate over url and type.
I would pass that into: </p>

<pre><code>anonFunction(a,b){
     $.ajax({url:a, type:b});
}
</code></pre>

<p>so after executing my function with a list, and an anonfunction, it would with my sample, do a request to google and yahoo.</p>

<p>Edit2:  </p>

<p>What the function would look like:</p>

<pre><code> //given data from above.
 special(data, function(a,b){
     $.ajax({url:a, type:b});
 });
</code></pre>
