I got a problem while developing javascript based idea..
Here's the main code,
$.post("datainlines.php", function(data) {
var lines = data.split("
");
for (var i = 1; i < lines.length; i++) {
sitename= lines[i]; sitetype=lines[i++];
if(i/2 == '0'){ alert current values in sitename and sitetype variables}
}
} );
This will get data in datainlines.php via POST, datainlines.php file data structure is like this -
Google
search
Stackoverflow
Questions
Yahoo
search
Facebook
social network
How to get site name and type in groups, like
Google
search
then
Stackoverflow
questions
is there anyway to group out and alert per every two loops in for loop ?