Open paulapereira1 opened 4 years ago
I can use command + d to make multiple cursors in vscode: https://code.visualstudio.com/docs/editor/codebasics#_multiple-selections-multicursor
We can't modify JS with CSS, but we can modify CSS using JS!
document.body.style.backgroundColor = 'red'
, for example.
Just realized I somehow didn't upload last Friday's Today I Learned, sorry!
Note: This is all relevant to the Weekend Project:
How to make a new directory and files:
Cd
into your main directory (i.e. Bootcamp)mkdir
name_of_directoryCd
into name_of_directorytouch
newFileName.html // you can create multiple files at once (i.e. touch index.html styles.css data.js)git init
code .
// to open VSCodeHow to set up your html, css and js files:
<link rel="stylessheet" href="styles.css"/>
</body>
, link to your js file:<script src = "data.js"></script>
<main></main>
tag inside of the body; it is common practice to have all of your content inside of the mainnpx serve
to create a local host 5000 To fetch the data from the google form:let
(since it will be updated/changed later) called responses:let responses = [];
Note: Cross Origin Resource Sharing (CORS) policy error is a security measure; solution is to put a server in between the two websites you are trying to work in between (i.e. Google Forms and your LocalHost5000); there’s a free website that helps us with that: http://cors-anywhere.herokuapp.com/
Note: Google “public apis” —> tools that people use to find free apis for web projects (Github option). Easiest one to work with/Sweet spot: Auth = No, HTTPS = Yes, CORS= Yes
const result = Papa.parse(data, {header: true})
responses = results.data
to the fetchUserResponses function.split()
: “Hello my name is Paula.split(“is”) //This will split the sentence in two strings from “is”, so that you get everything on the left of “is”, and everything on the right, separated by a comma: [“Hello my name”,”Paula”] First item of the array:[0] Second item of the array: [1] […] i.e. “Hello my name is Paula.split(“is”) [1] Will return “Paula”?search=
at the end of a url will allow you to search within the dataset of an api i.e. ?search=MarioHow to make a new repository on GitHub
git remote add origin insert_url_here
git push -u origin master
Pending questions: In the video how did Andy modify multiple lines in the js at once? @andyweiss1982 Can we reference/modify (with CSS) JS variables? @andyweiss1982