Plan and done for July-21-2017
What will I learn today?
Dive into JS.
Done
Digged into project of a quotation machine from FreeCodeCamp (here - https://www.freecodecamp.org/challenges/build-a-random-quote-machine). The results are:
- as a Codepen playground - https://codepen.io/alstof/pen/qjzzMb;
- as a single page -
Learned/recalled:
- don't use function call in callback - just function name needed, so no parenthesis -
function(params, callback())vsfunction(params, callback), here is SO - https://stackoverflow.com/a/21616421; - dinamically regenerate twitter button to get desired tweet text inside a twitter web intent (what is web intent described in the article about twitter button - https://dev.twitter.com/web/tweet-button)- https://twittercommunity.com/t/how-to-replace-data-text-content-with-javascript-variable/19404/4;
- practiced
fetch, encountered CORS obstacles - quote API and Codepen don't allow cross origin js, solved it with proxy - https://cors-anywhere.herokuapp.com/; - found a couple of this quote API - first is Forismatic - https://forismatic.com/en/api/ and second is WikiQuote - https://github.com/natetyler/wikiquotes-api.