Javascript Chp. 5
window
The ____________________ object represents a web browser window.
clearTimeout();
The ____ method is used to cancel a setTimeout() method before its code executes.
clearInterval()
The ____ method is used to clear a setInterval() method call.
setInterval()
The ____ method repeatedly executes the same code after being called only once.
location
The ____ object allows you to change to a new web page from within JavaScript code.
document fragment
A set of connected nodes that are not part of a document is known as a(n) ____.
No. The information is private. It's an essential security feature.
Can you use JavaScript access URLs contained in the History object? If yes, provide code to do so. If no, why not?
SetTImeout () executes code after a specific amount of time has elapse. It's sister function is clearTimeout() The setInterval repeatedly executes code after an amount of time has passed. it's sister function is clearInterval.
Describe the differences between the setTimeout() and setInterval() methods, and specify the method you use to cancel each.
node
Each item in the DOM tree is known as a(n) ____________________.
Navigator
The ____ object is used to obtain information about the current web browser.
the windoe object represents the browser window. It's related to the document object because the web page is diplayedin it. The window is the parent object of all other objects.
Explain the relationship between the Window object and the Document object.
textContent
For security reasons, you should use the ____________________ property when possible instead of the innerHTML property.
Assign values to the left and top options of the options argument. Subtract width of window from screen width and divide the remainder by two, and assign resut to left option. Same goes for vertical window. Subtract height of the window from screen height, divide remaining by two, and assign reult to top option.
How can you center a web browser window in the middle of the display area?
through thigns like openWin whcih is created by the values specified in the windows.open() method.
How can you control a new window from the browser window that created it?
focus()
In order to make a window the active window, you use the ____ method of the Window object.
Rarely because javascript implementations are standardized across the current versions of all major browsers. Browser can be challenging to get conclusive information. Developers instead use browser detection capabilities built into libraries.
Is the Navigator object commonly used in determining which type of browser a user is running? Why or why not?
appendChild() is the most basic bitch of all of them. Adds node as a child of a parent node that is specified. Always appended after any existing childing nodes. Use insertBefore() when you need to place it in a specific place among existing bitches.
Name two ways to add a node to the DOM, and explain when you'd use each.
self
One way of referring to the Window object is by using the ____________________ property, which refers to the current Window object.
the DOM tree
The DOM hierarchy is also known as ____.
document object model
The Document object branch of the browser object model is represented by its own object model called the ______________________________.
length
The History object contains a single property, the ____ property, which contains the specific number of documents that have been opened during the current browser session.
setTimeout();
The ____ method is used in JavaScript to execute code after a specific amount of time has elapsed.
getElementsbyTagName(h2); getElementsByClassName(seciont); querySelector("h2 section);
The first h2 element in a web page is created with the following tag pair: <h2 id="local" class="section"></h2>. Provide three different examples of code to reference this element using three different methods.
inner HTML allows you to acces adn write HTML tags along with text, while text Content strips these out. Text conent strips out striclty the text and leaves out the code.
What is the difference between the content accessed by the textContent and innerHTML properties?
reference an attribute of an element document.getElementById( "homelink) reference CSS propery of element getElementByID("logo:).style.fontFamily;
What is the difference in syntax between referencing a CSS property of an element and referencing an attribute of an element? Give an example of each.
options
When you open a new web browser window, you can customize its appearance using the ____ argument of the window.open() method.
fontFamily
Which is the correct way to reference the CSS font-family property in JavaScript when using dot notation?
document.getElementById("homeLink").href
Which is the correct way to reference the href attribute of the element with the id value homeLink?
inserBefore()
Which method adds a node to a parent node before one or more existing child nodes?
getElementsByClassName()
Which method does NOT return a node list or HTML collection? a. getElementById() b. getElementsByTagName() c. getElementsByClassName() d. getElementsByName()
querySelector()
Which method returns a single element?
querySelector("p figure img")
Which method returns all elements in a document that match the selector p figure img?
getElementsByTagName("h1")
Which method returns all h1 elements in a document?
getElementsByClassName("first")
Which method returns the element created by the HTML tag pair <p id="weekend" class="first"></p>?
createElement()
Which results in a node that exists independently of the DOM tree?