So, I have the following js:
function(data){
var length = (data.number.split(',').length) - 1; //Holds numbers such as "1,2,3,4,5" which gives "5".
var content = data.content; //Holds the phrases
alert(content);
for (var i=0; i<length; i++) {
var indi_cont = data.content[i];
alert(indi_cont);
};
};
Here, the length is 5 and I get 5 array of values for the alert(content) (note the " , " at the end of values).
`my name is,how are you,i am good,thank you,hey you,`
Using the for function, I want to separate each value as below:
my name is
how are you
i am good
thank you
hey you
However, i am getting alert(indi_cont) as following:
m
y
n
a
m
So, it looks like individual characters are shown instead of the whole phrase.
How do fix this?
Thanks!
my name is,how are you,i am good,thank you,hey you,?data.contentholds the phrase. =)