Javascript - perform something in certain intervals in FOR LOOP
<p>I got a problem while developing javascript based idea..</p>

<p>Here's the main code, </p>

<pre><code> $.post("datainlines.php", function(data) { 

        var lines = data.split("\n");

           for (var i = 1; i &lt; lines.length; i++) {

             sitename= lines[i]; sitetype=lines[i++]; 

             if(i/2 == '0'){ alert current values in sitename and sitetype variables}

            }

       } );
</code></pre>

<p>This will get data in datainlines.php via POST, datainlines.php file data structure is like this - </p>

<pre><code>Google
search
Stackoverflow
Questions
Yahoo
search
Facebook
social network
</code></pre>

<p>How to get site name and type in groups, like </p>

<pre><code>Google
search 
</code></pre>

<p>then</p>

<pre><code>Stackoverflow
questions
</code></pre>

<p>is there anyway to group out and alert per every two loops in for loop ?</p>
