QUESTIONS AND ANSWERS|| ALREADY
GRADED A+ || GUARANTEED PASS || LATEST
VERSION 2025
What is a visual homograph? How do we deal with them? - ANSWER-Two
different characters that look the same. Solution is heuristics that warn users
when languages are mixed
What is a code point? - ANSWER-An integer value that corresponds to a
character name. The structure is U+hex
What is a plane in code points? What does plane 0 correspond to? - ANSWER-
In U+nnmmmm, same value of nn means the same plane. Basic multilingual
plane which has practically everything you could need
What is UTF-8? - ANSWER-Encoding of code point in a sequence of bytes
(octets)
What is 0110 1101 in code points? - ANSWER-U+006D
What is 1101 0000 1011 1111 in code points? - ANSWER-U+043F
What is the rule for an encoding of length K in UTF-8? - ANSWER-First byte
starts with k 1's, then 0. Subsequent k-1 bytes each start with 10
,What is a byte order mark (BOM)? - ANSWER-Adds a code point that can't
exist in big or little endian at the start of the file to check which one it is
What's the best way to reuse an Encryption function? - ANSWER-Parameterize
it by a number and let this number be the secret two users share
What is a tree node in javascript? - ANSWER-an object (ie an element with
attributes or many properties)
What are the properties of a javascript object? - ANSWER-parentNode,
childNodes, firstChild, lastChild, nextSibling, previousSibling
innerHTML
tagName
attributes, name, id, class
style
What are some javascript object methods - ANSWER-appendChild(node),
removeChild(node), insertBefore(node)
hasAttribute(attr), removeAttribute(attr), getAttribute(attr), setAttribute(attr)
getElementsByTagName(name)
What are the 4 ways to find a node in a tree? - ANSWER-1. Hard coding with
"flat" techniques (downside bc if anything in structure changes it changes)
2. Using an element's name attribute (downside bc if anything in structure
changes it changes)
3. getElementByID (downside everything needs an id)
4. Combination: element ID for form, arrays for options in selection element
What are the three things you need to make a document interactive? -
ANSWER-Widgets, Events, Event Listeners
, Widgets (HTML elements) - ANSWER-buttons, windows, menus
Events - ANSWER-mouse clicked, window closed, button clicked
Event Listeners - ANSWER-listen (wait) for events to be triggered and then
perform actions to handle them
Describe Event Handling (event driven programming) - ANSWER-Occurs as a
loop
Program is idle
User performs an action
Action generates an event (object)
event is sent to the program which responds (ie code executes)
program returns to being idle
What are the three parts of the event-handling mechanism? - ANSWER-Event
source- widget user interacts with
Event object- encapsulated info about event
Event listener- function called when event occurs that responds to event
What are the programmers tasks when it comes to events? - ANSWER-Define
an event handler
Register handler with a source element
When an event occurs, which element's handlers are notified? - ANSWER-
propagation path first (from root to smallest element)
The 3 phases