Download Counter | Sololearn: Learn to code for FREE!

+3

Download Counter

Please help fam, I've recently started a music download site, but I'm struggling with the downloads features.. what I'm trying to do is, everytime the user clicks the download button/link, count goes up, how can I do this please? your responses will be highly appreciated.

4/12/2018 4:21:20 AM

Emmett N. Lipholo

3 Answers

New Answer

+8

the approach i would take is make each song its own inherited object like so: function Song(){ this.title = ""; this.lyrics = ""; this.genre = ""; this.duration = 0.00f; // etc etc this.downloads = 0; } var author_song = new Song(); when the download button has been clicked... author_song.downloads++; the main solution is to have each song contain its own personal download variable and increment it each click

+5

Nyapa Lipholo No problem ;) happy to help :)

+2

Thank you so much, I'll try look into that... thank you 🙏🏾