Personally I would do this with PHP but maybe someone has an pro/contra for doing this with JavaScript:
- I (will) fetch a few song details (about ten per page load) from Soundcloud
- afterwards the statistic (played this week/total, liked this week/total etc.) will be displayed in a table
That’s it – nothing special.
I can solve it like this:
- let PHP do the stuff and render the whole page at once
This will of course take some time before the page is rendered.
Is there any advantage of doing this with JavaScript? I can only think of:
- the page renders faster (with the disadvantage that the results may not be displayed instantly)
I’d say that doing it via JavaScript will actually take longer, as you’ll have to connect again. Although, it may give an illusion of “being faster” (though I doubt it’ll be noticeable).
I suppose it might depend on your usage cases too.
How are you handling authentication with SoundCloud?