learn-co-curriculum / js-strings-and-numbers-readme Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
If you read through the MDN about Element.innerHTML, if im reading it correctly it basically says you open your site up to cross-site scripting if you use .innerHTML.
If all your doing is getting the text why would you not teach students to use .textContent or .innerText?
MDN Element.innerHTML
MDN Node.textContent
MDN Node.innerText
Im instructed to modify the variables in the JS tab to be my actual name and height. However, when I get to the instructions about adding 2 to my height, I am first instructed to type heightSelector.innerHTML into the console. This is giving me an error. Should I also have changed my HTML tab as well?
Hi, no big deal, but as I was doing the first lab, the "Sign up for GitHub" message kept popping up. Even after I closed it, as soon as I moved around the screen it would pop up, interfering with navigation.
I finally bit the bullet and linked a GitHub account - maybe this is the intent of the popup, but IMHO once you close it it should not pop up for the rest of the session...
I type the code into the JS tab just as the instructions say: var nameSelector = document.querySelector('#name') and my error messages displayed in the Console are "Uncaught SyntaxError: Unexpected end of input" and "Uncaught SyntaxError: Invalid or unexpected token"
I copy and paste the code and I get the same error message. I check to see if the Console is pointed to CodePen and it is.
If I type nameSelector, the variable doesn't pull up the correct information.
This was working last night, but I felt I did not completely understand the lesson so I wanted to go over it again, and now I am just confused that I'm doing something incorrectly.
When I follow the lab to update the strings and numbers, it doesn't accept an update on the name and number at the same time. I restart and it gives the same issue again.
Hi. When I click on "top" in Console, I don't have the CodePen Preview as an option. My only two options are CodePen.io/ and CodePen(index.html). Which one of the two should I be using?
Thanks
Many questions revolve around not understanding how to use the CodePen. They are confused at how to find it in the console and the embedded version doesn't work well all the time. Maybe include instructions on viewing it on its own page here: https://codepen.io/joemburgess/pen/OpwrqM
They usually have zero problems once working there.
This part I have done under Scratch JS tab with dropdown changed to learn.co/tracks/bootcamp...strings-and-numbers' as follows :
var nameSelector = document.querySelector('#name');
var heightSelector = document.querySelector('#height');
When I then return to Console tab and change that drop down to 'Codepen Preview for OpwrqM'
and then type:
nameSelector
An error is displayed and when I type:
var nameSelector
my output is:
undefined
Something must be unable to communicate the necessary information to console, what piece am I missing?
Screenshots below
For the first example code: document.querySelector('#name')
--if you the desired return is to JUST be: "Joe Burgess"... shouldn't " .innerHTML " be added to the code?
i.e:
document.querySelector('#name').innerHTML
I was just wondering. As going through the lessons I noticed that the specific values are referred to using single quotes and other times they are using single quotes. Is there a difference? I do not see anything different when I was playing around with it.
Also, when I declare var heightSelector = "string" and then parse it into an int. I can only perform one operation on it as int. Subsequent operations default it back to a string. This is normal behavior correct?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.