HW 13        IFSC 3300        Due W 11/30/2022 (W after Fall break!)

Please email your answers to: IFSC3300HW@gmail.com. Do not submit code as a shared document, because too often we run into permission problems and format conversion problems. Instead, put it in the body of the email or, if you feel strongly about it, as an attachment.

NOTE: Qs 1-6 are fairly quick. Q7 is longer, so budget your time accordingly.

 

1. Does window.document.getElementById() do the same thing as document.getElementById()? Why or why not? You can try this out in a sandbox without buttons, or you could make two buttons, one for running each of the two code snippets. If you do it with buttons, feel free to add them to a collection of buttons from previous assignments.

2. Does window.innerHeight have the same value as screen.height? Why or why not? You can try this in a sandbox without buttons, or use buttons.

3. Does screen.height have the same value as screen.availHeight? Why or why not? You can try this in a sandbox without buttons, or use buttons.

4. Get the window.location.href property. Does the result make sense? You can try this in a sandbox without buttons, or use buttons.

5. Does your browser have cookies enabled? (Try navigator.cookieEnabled). We will discuss cookies more next time. You can try this in a sandbox without a button, or use buttons.

6. Does window.alert(“Hi!”); do the same thing as alert(“Hi!”); ? Why or why not? You can try this in a sandbox without buttons, or use buttons.

7. Recall the DOM. Write a script that has buttons for moving around in the DOM tree. To review how to move around in the tree, see the video of the last DOM lecture (where we discussed the topic "DOM Navigation"). Different buttons could access childNode, parentNode, nextSibling, for example. It could print out nodeName, nodeType, nodeValue, use a for-in loop to show the components of a give node, etc. Feel free to add the buttons to a collection of buttons from earlier assignments for easy future reference.