AJAX
file: vote/static-content/index.html
url: http://SERVER:PORT/index.html
For this question you will add Ajax to the work you completed in q1js OR q1react.
- Choose one of
q1js/index.html
or q1react/index.html
- If you chose
q1js/index.html
then copy this to vote/static-content
cd ~/www/repo_UTORID_309exam/finalExam
cp q1js/index.html vote/static-content/
- If you chose
q1react/index.html
then copy this to vote/static-content
cd ~/www/repo_UTORID_309exam/finalExam
cp q1react/index.html vote/static-content/
- Continue working on q3 on
file: vote/static-content/index.html
- Modify
file: vote/static-content/index.html
so that, instead of storing the database
in the browser, it uses the restful api to interact with votes
stored behind the node.js server. Now whenever you click a button,
an Ajax request is sent to the node server and the response appears
in the browser. The behaviour should be identical to that of q1js and q1react, except that
now votes are shared between all users.