DATT 1939 Week 8 - Minimum Code/Techniques to Practice Before Week 9


Catch up on Javascript from week 7:

Randomness with Javascript -2  Creating part of document randomly
    Make sure you have edited and experimented with different parts of the following:
	Random Text:  ex_random_text_elementID.html 
	Random Image: ex_randomImage_better.html
	

Understand how to work with basic JS loops and JS keypresses.

Edit some examples of JS loops and JS keypresses to explore simple or more involved possibilities. 
  What could you edit the examples to do? What previous JS could they combine with?

  Edit challenge: Try to fix the example "Better version of count up the elephants" in the loop section so that the word "elephants" is changed
   to "elephant" (singular) when the loop is at 1, but changes to "elephants" (plural) when the loop is at 2 and above.

  Edit challenge: Try to figure out how to make a page that uses keypresses to change the current location of the window using window.location.replace() 
  (which is at the bottom of the week 7 section of the Resources page)


PLEASE NOTE: Edit Challenges are little suggested exercises that give you a JS problem to chew on. Trying to do them is important for learning. 
  If you can't solve them quickly or easily, that is fine, as long as you make some progress towards solving them. 
  If you can't solve them at all, that may be OK, if you don't need to use the JS category in question in your A2. 
  If you do need to use the JS category, get help from someone in class, or from your TA,
   so you can start to understand how to solve some of these little challenges. 


Look over examples of JS Div interactions. 
  Look at the source code of the JS Div interactions examples.
  Do any of these examples seem relevant or adaptable to things you might like to do for your A2?



Some More Code/Techniques To Try This Week


Edit some examples of JS Div interactions to explore simple and then more involved possibilities. 
  What could you edit the examples to do? What previous JS could they combine with?


Edit challenge: Try to figure out how to combine a JS loop with string concatenation (a string held in a variable that you build up by 
  concatenating new parts on to it). Combine a loop with string concatenation to allow the user to input a number at a prompt, 
  convert the user's input from a string to a number, and have the script print a word on the page that number of times.

   HINT: at some point, you will likely need to set the variable holding the string to be itself + more string data, like so:
      morewordsvar = morewordsvar + " BEETLEJUICE!";



If you  want to work ahead, look at week 9, 10, and 11 techniques on the Resources page...



If you want more, feel free to look up simple online JavaScript resources and/or ask your tutorial leader for pointers...