What is the best way to code a voting system using javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the best way to code a voting system using javascript

I have a website with 14 pictures and I want to be able to code a way to vote on your favorite picture and show the results but I'm really not sure how to go about it at all. What is a way to achieve this or something similar to this. I am using an external javascript file in notepad to code all my javascript.

3rd Nov 2019, 7:33 AM
Kayla Torrez
Kayla Torrez - avatar
6 Answers
+ 4
For simple voting data, you could use json server on nodejs server to build rest-api data. Frontend javascript can then read or write the server json file by using api fetch or axios. Server side coding: https://glitch.com/~voting-sl-cources Rest api endpoint: https://voting-sl-cources.glitch.me/courses Frontend Sololearn code https://code.sololearn.com/WuSBUcgTWH8m/?ref=app
3rd Nov 2019, 4:01 PM
Calviղ
Calviղ - avatar
3rd Nov 2019, 4:11 PM
Burey
Burey - avatar
+ 4
Can't see server side source code on glitch
3rd Nov 2019, 6:37 PM
Adi Pratama
Adi Pratama - avatar
+ 2
Adi Pratama-Universitas Brawijaya server run by json server, it only needs to have db.json to setup rest api.
3rd Nov 2019, 11:57 PM
Calviղ
Calviղ - avatar
+ 1
If you know Python, then u can use Django as the back end
9th Nov 2019, 9:25 AM
Isaac Frank
Isaac Frank - avatar
0
Thank you everyone!
12th Nov 2019, 5:30 PM
Kayla Torrez
Kayla Torrez - avatar