<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic getJSON with for looping in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/getJSON-with-for-looping/m-p/1122098#M76479</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have to read several URL using JSON. I am using for looping to read each URL.&lt;/P&gt;

&lt;P&gt;The problem is the getJSON result is always different base on URL respond.&lt;BR /&gt;
	Is it any way to wait for looping until getJSON process is finished ?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Muhammad&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;input_string = window.localStorage.getItem("all_id");
    var parts = input_string.split(',');

 for (var t=0; t&amp;lt;parts.length; t++){
        url = base_url + "products/" + parts&lt;T&gt; + '/reviews?' + ck + '&amp;amp;' + cs;
  
        $.getJSON(url, function(data){
          $.each(data, function (index, value2) {
              review_detail = '';
            for (var i = 0, len = value2.length; i &amp;lt; len; i++) {
                star_number = get_star(value2&lt;I&gt;.rating);
                //alert (star_number)
                review_detail += star_number + "&amp;lt;br&amp;gt;";
                review_detail += value2&lt;I&gt;.review + "&amp;lt;br&amp;gt;";
                review_detail += value2&lt;I&gt;.reviewer_name + "&amp;lt;br&amp;gt;";
                //alert(review_detail);
            }
          });    

        });

    
    }&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/T&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jul 2016 09:27:18 GMT</pubDate>
    <dc:creator>Muhammad_Y_Efendi</dc:creator>
    <dc:date>2016-07-11T09:27:18Z</dc:date>
    <item>
      <title>getJSON with for looping</title>
      <link>https://community.intel.com/t5/Software-Archive/getJSON-with-for-looping/m-p/1122098#M76479</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have to read several URL using JSON. I am using for looping to read each URL.&lt;/P&gt;

&lt;P&gt;The problem is the getJSON result is always different base on URL respond.&lt;BR /&gt;
	Is it any way to wait for looping until getJSON process is finished ?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Muhammad&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;input_string = window.localStorage.getItem("all_id");
    var parts = input_string.split(',');

 for (var t=0; t&amp;lt;parts.length; t++){
        url = base_url + "products/" + parts&lt;T&gt; + '/reviews?' + ck + '&amp;amp;' + cs;
  
        $.getJSON(url, function(data){
          $.each(data, function (index, value2) {
              review_detail = '';
            for (var i = 0, len = value2.length; i &amp;lt; len; i++) {
                star_number = get_star(value2&lt;I&gt;.rating);
                //alert (star_number)
                review_detail += star_number + "&amp;lt;br&amp;gt;";
                review_detail += value2&lt;I&gt;.review + "&amp;lt;br&amp;gt;";
                review_detail += value2&lt;I&gt;.reviewer_name + "&amp;lt;br&amp;gt;";
                //alert(review_detail);
            }
          });    

        });

    
    }&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/T&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 09:27:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/getJSON-with-for-looping/m-p/1122098#M76479</guid>
      <dc:creator>Muhammad_Y_Efendi</dc:creator>
      <dc:date>2016-07-11T09:27:18Z</dc:date>
    </item>
    <item>
      <title>If you are trying to execute</title>
      <link>https://community.intel.com/t5/Software-Archive/getJSON-with-for-looping/m-p/1122099#M76480</link>
      <description>&lt;P&gt;If you are trying to execute a specific action after every successful getJSON reponse, I recommend implementing a success function that calls the appropriate function wit the appropriate parameters. You won't need a for loop as you would be recursively calling your function that performs the necessary actions per the url.&lt;/P&gt;

&lt;P&gt;You can learn more about the callback methods associated to getJSON at&amp;nbsp;&lt;A href="http://api.jquery.com/jquery.getjson/"&gt;http://api.jquery.com/jquery.getjson/&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 15:43:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/getJSON-with-for-looping/m-p/1122099#M76480</guid>
      <dc:creator>Elroy_A_Intel</dc:creator>
      <dc:date>2016-07-11T15:43:00Z</dc:date>
    </item>
  </channel>
</rss>

