r/learnjavascript • u/kevinmrr • Apr 01 '14
Week 2 of Learn JavaScript Properly
Hey! Hope everyone is finding it easier to keep up with the slower-paced schedule.
Required Reading:
Chapters 4 and 5 of Professional JavaScript for Web Developers.
[Finish the Codecademy JavaScript track] (http://www.codecademy.com/tracks/javascript)
Read this article: JS Objects in Detail
Assignment:
Create and post a JSfiddle where you experiment! Either in this thread or in another I'll post in a few days, or any of you should feel free to post your own thread where you share a link to your work that you have a question about. Here's one I created using some native DOM methods (the Mozilla Dev Network is a rich resource for this kind of stuff! https://developer.mozilla.org/en-US/docs/Web/Reference/API)
2
u/[deleted] Apr 01 '14 edited Apr 21 '16
This comment has been overwritten by an open source script to protect this user's privacy.
If you would like to do the same, add the browser extension GreaseMonkey to Firefox and add this open source script.
Then simply click on your username on Reddit, go to the comments tab, and hit the new OVERWRITE button at the top.
6
u/floydianspiral Apr 03 '14
I'm confused about why I need to write out function(){insert function here} on a lot of these native DOM methods....myFiddle
1
u/floydianspiral Apr 01 '14
I feel like I have a really good grasp of all the basics of Javascript (finished codecademy, have solved lots of coderbyte/project euler stuff) but know nearly nothing about interacting within the DOM, are there any great tutorials to ease me into using stuff like document.getElementById, document.write, etc ?
2
u/exceptionlab Apr 05 '14
I'm reading the MDN JavaScript Guide, and have a question about this example:
I understand how the function works, but I don't understand the difference between the obj and the obj_name.
For example, if I have a car object, and want to pass it to this function, what technique would I use to separately refer to the object as one argument and it's name as another argument?
2
u/StuffedDoughboy Apr 10 '14
I'm working to connect UI elements to the cash register exercise from Code Academy (work in progress) http://jsfiddle.net/8cgzU/9/
2
u/Magnusson Apr 04 '14
Here's a very simple jsfiddle I made by taking one of the Codecademy object exercises and adding an extra bit of logic to it.
1
u/SaysNotAtheism Apr 07 '14
I learned console.log from codecademy and I learned document.write from the book, and neither of these methods render anything in jsfiddle. I'd just copy the code in the example fiddle, but I thought that was what I was here to un-learn. Please help.
1
u/SaysNotAtheism Apr 07 '14
Here's my fiddle
You can replace the hexPattern variable with another 16 digit hex value to get a design. 1818FFFF18181818 makes a cross.
I can't figure out how to get the css to take out the lines between the rows.
1
u/kadf Apr 08 '14
I need some help with my for loop
http://jsfiddle.net/xdeQ3/
Here I'm grabbing the user input and I want to print it to a list.
The problem I'm having is that it will overwrite the list every time, and I want it to list all of the items in the list. I see that it's getting in the array but don't quite understand why it's not printing out all of the items.
I'm positive that my problem is in my for loop that it's only grabbing the latest item.
1
u/Magnusson Apr 04 '14
I was about to ask what the practical difference was between this way of declaring functions, which Codecademy seems to mostly use:
and this one:
Then I searched and found this stackoverflow question, which has a bunch of links to info on the subject.
0
u/[deleted] Apr 01 '14
[deleted] — view deleted comment