I need to increment <div id="friends0"> ....... <div
id="friends25"> .. and so on...
That is... for every Friend of the user. Iam fetching some data from
my server. And display them.
 I want to create a unique div ID for each of the html content fetched
for each user. But there is some problem in iterating the div iDs...
there problem is in the statement
document.getElementById(increment).innerHTML = html;  where
'increment' is a variable containing "friends"+i. where i iterates....
What should i do to make this code work??

Here is the code i have used.
------------------------------------------------------
var i=0;
var increment="friends"+i;

 viewerFriends.each(function(person) {

 makePOSTRequest();

function makePOSTRequest();
{
.
.
.
.
   gadgets.io.makeRequest(url, reqpost, params);
 }

  function reqpost(obj) {

      var str = obj.text;
      var html =  str.substr(0,400);

document.getElementById(increment).innerHTML = html;      // i tried
even (""+increment+"") and without assigning it to a variable i tried
directly also ("friends"+i)

  };

i=i+1;
increment="ifriends"+i;

});

 ---------------------------------------
if this is not a proper way. What all the other ways can i fetch data
from my server for each person???

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to