I’m (attempting to) write a cross-platform web app which seems to be putting my skills to the test. I’m struggling with a function within a loop.
The flow like so:
User downloads app - assumed connected to internet - fetch data and store in local storage.
User loads app - if connected download data again and store again / else fall back on local data
Problem? I’m not overly experienced in JS and never really needed to use it for data manipulation. I basically want to limit the string length of the body of news stories.
From console:
[PHP]
"+ truncateTitle(data.stories[i].body) + "
[/PHP]
Code:
[PHP]
I can find lots of resources online, but none to do it within a loop. Please help! I’m going stir crazy on this one!