S
sskk
I am trying to send nested data.
I thought i can only send as json so i tried to make json text like the
following.
the structure has 3 levels ( continents, countries, state )
"{ 'continents' : [{ 'continent': '1', 'countries': [{ 'country': '3'}]}]}"
just to make the json text takes forever.
Is there another solution to this?
for (var continent in arrRepRegions) {
if( $l == 0 ){
jsonRepRegions += "{ 'continent': " + continent;
$l++;
}else
jsonRepRegions += ",{ 'continent': " + continent;
for( var country in arrRepRegions[continent] ){
if( $j == 0 ){
jsonRepRegions += ",'countries': [";
$j++;
jsonRepRegions += "{ 'country': " + country;
}else{
jsonRepRegions += ",{ 'country': " + country;
}
I thought i can only send as json so i tried to make json text like the
following.
the structure has 3 levels ( continents, countries, state )
"{ 'continents' : [{ 'continent': '1', 'countries': [{ 'country': '3'}]}]}"
just to make the json text takes forever.
Is there another solution to this?
for (var continent in arrRepRegions) {
if( $l == 0 ){
jsonRepRegions += "{ 'continent': " + continent;
$l++;
}else
jsonRepRegions += ",{ 'continent': " + continent;
for( var country in arrRepRegions[continent] ){
if( $j == 0 ){
jsonRepRegions += ",'countries': [";
$j++;
jsonRepRegions += "{ 'country': " + country;
}else{
jsonRepRegions += ",{ 'country': " + country;
}