title: Jquery $each() alternative
body: <p>I am working on a webapp using Jquery and i use $each() for iterating some values. Now in the Firebug i observe that there are multiple GET calls like this GET http://localhost/Centrifuge42/forecast.py?data. so is there any way to do this in a single GET call? My code is as follows:</p>
  
  <pre><code>function showGraph(de, node, futureData) {
      //alert("show");
      //alert(futureData);
      var trcounter = $('#timeContainer tr').length;
      //alert(trcounter);
      if(trcounter &gt; 0)
          $('#timeContainer tr').remove();
      var dataLen = de.length;
      console.log(dataLen);
      $.each(de, function(key, val){
      //$('#timeContainer').find('tr',function(){})
      var dataLen = de.length;
      //alert(val);
      //alert(node[key]);
      //alert(dataLen);
      var containertr = document.createElement("tr");
      var containertd = document.createElement("td");
      containertr.setAttribute('id', 'forecasttr'+key);
      //containertr.setAttribute('onClick', "showFutureForecast('forecast"+key+"', '"+node[key]+"');");
      var containerHiddenNode = document.createElement("input");
      var containerHiddenTime = document.createElement("input");
  
      containerHiddenNode.setAttribute('type', 'hidden');
      containerHiddenNode.setAttribute('value', val);
      containerHiddenNode.setAttribute('id', 'forecastVal');
  
      containerHiddenTime.setAttribute('type', 'hidden');
      containerHiddenTime.setAttribute('value', node[key]);
      containerHiddenTime.setAttribute('id', 'forecastNode');
  
      var containertdHTML = "&lt;div id='chart"+key+"' class='chart'&gt;&lt;/div&gt;";
      containertd.setAttribute('style','background-color:#FF99FF');
      containertd.innerHTML = containertdHTML;
      containertd.appendChild(containerHiddenNode);
      containertd.appendChild(containerHiddenTime);
      containertr.appendChild(containertd);
      $('#timeContainer').append(containertr);
  
      graph = new SimpleGraph("chart"+key, {
            "data": val, 
            "title": node[key]+" Forecast",
            "xlabel": "Duration",
            "ylabel": "Time Series"  
          });
        //body.innerHTML += "&lt;div id='infobox' class='infobox' style='display:none;'&gt;Test&lt;/div&gt;";
        var chart = document.getElementById("chart"+key);
        var elem = document.createElement('span');
        //elem.setAttribute('id', 'infobox');
        elem.setAttribute('class', 'infobox');
        elem.setAttribute('style', 'display:none;');
        //elem.innerHTML = 'Test';
        chart.appendChild(elem);
        var idat = "chart"+key;
        var future = parseInt(futureData);
        //alert(-future);
        var data = $("#"+idat+" circle").slice(-future).attr('fill');
        console.log(data);
        //$("#"+idat+" circle:nth-last-child("+-future+")").attr("fill", "#ff0000");
        if(typeof futureData != 'undefined')
        {
         if (futureData!=0){
          $("#"+idat+" circle").slice(-future).attr("style", "stroke:#FF0000");
          }
        }
      //console.log(val);
      });
  </code></pre>