HTML Flashcards
Where do you put non-visible content about the HTML document?
In the tag
Where do you put visible content about the HTML document?
In the tag.
Where do the and tags go in a valid HTML document?
Both are within the tag with coming before .
What is the purpose of a declaration?
declares the specific language that the code will be in.
Give five examples of HTML element types.
<p>, </p>
<div></div>
, <img></img>, <h1>, </h1>, head
What is the purpose of HTML attributes?
They give additional information about the contents of an element.
Give an example of an HTML entity (escape character).
® ® ““”
How do block-level elements affect the document flow?
block-level elements appear on new lines in the browser window.
How do inline elements affect the document flow?
inline elements will appear to continue on the same line as neighboring elements.
What are the default width and height of a block-level element?
width of 100% the parent container, full width available
length default to whatever height it needs to have depending on content.
What are the default width and height of an inline element?
Height and width are the exact height and width of the content.
What is the difference between an ordered list and an unordered list in HTML?
An ordered list will automatically assign numbers to the list elements underneath it. an unordered list uses bullets.
What HTML tag is used to link to another website?
<a></a> anchor tag
What is an absolute URL?
web address in the browser to visit a specific page. has domain name and path. links to website other than current one.
Is an HTML list a block element or an inline element?
Block
What is a relative URL?
relative url if linking within the same site. has the name of the file or navigation to folder. - no domain name.
How do you indicate the relative link to a parent directory?
<a></a>
How do you indicate the relative link to a child directory?
<a></a>
How do you indicate the relative link to a grand parent directory?
<a></a>
How do you indicate the relative link to the same directory?
<a></a>
What is the purpose of an HTML form element?
gather data from clients.
specifies the method and URL for the page on the server that will receive the form information.
Give five examples of form control elements.
input, label, select, textarea, option
Give three examples of type attribute values for HTML input elements.
image, submit, file, checkbox
Is an HTML input element a block element or an inline element?
inline
What are the six primary HTML elements for creating tables?
Table, thead, tbody, tfoot, th, td
What purpose do the thead and tbody elements serve?
thead contains the first row of the of the table that has the headings.
tbody contains the content of the tables
Give two examples of data that would lend itself well to being displayed in a table.
Finance sheets, prices, schedules
What kind of inheritance does the JavaScript programming language use?
JavaScript includes a specific kind of inheritance known as prototype-based (or prototypal) inheritance.
What is a prototype in JavaScript?
prototype is simply an object that contains properties and (predominantly) methods that can be used by other objects.
How is it possible to call methods on strings, arrays, and numbers even though those methods don’t actually exist on objects, arrays, and numbers?
if those are inherited as a prototytpe
If an object does not have it’s own property or method by a given key, where does JavaScript look for it?
it’s parent
What is a client?
A client is the receiving end of a service or the requestor of a service
What is a server?
provides functionality for other programs or devices
Which HTTP method does a browser issue to a web server when you visit a URL?
The browser sends a HTTP request to the server. get method
What three things are on the start-line of an HTTP request message?
An HTTP method, a verb (like GET , PUT or POST ) or a noun (like HEAD or OPTIONS )
target
httpversion
What three things are on the start-line of an HTTP response message?
Status line, header and body.
What are HTTP headers?
Response headers hold additional information about the response, like its location or about the server providing it
Is a body required for a valid HTTP request or response message?
Exercise
no
What does the new operator do?
Creates a blank, plain JavaScript object.
Adds a property to the new object (__proto__) that links to the constructor function’s prototype object
Note: Properties/objects added to the construction function prototype are therefore accessible to all instances created from the constructor function (using new).
Binds the newly created object instance as the this context (i.e. all references to this in the constructor function now refer to the object created in the first step).
Returns this if the function doesn’t return an object.
What property of JavaScript functions can store shared behavior for instances created with new?
You can add a shared property to a previously defined object type by using the Function.prototype property.
What does the instanceof operator do?
The instanceof operator tests to see if the prototype property of a constructor appears anywhere in the prototype chain of an object.
What is a “callback” function?
A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.
Besides adding an event listener callback function to an element or the document, what is one way to delay the execution of a JavaScript function until some point in the future?
settimeout
How can you set up a function to be called repeatedly without using a loop?
setinterval
What is the default time delay if you omit the delay parameter from setTimeout() or setInterval()?
0
What do setTimeout() and setInterval() return?
intervalID
What is AJAX?
Asynchronous JavaScript And XML
A browser built-in XMLHttpRequest object (to request data from a web server)
JavaScript and HTML DOM (to display or use the data)
tool for making network requests for the website without having to load a new webpage
What does the AJAX acronym stand for?
Asynchronous JavaScript And XML
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
load event
Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
xhr prototypes from xhr event target and that prototypes from eventtarget
What is a code block? What are some examples of a code block?
code enclosed by {}
used in if, for, while, functions
What does block scope mean?
Means while in the block, which is the {}, the variables are only accessible within that block,
What is the scope of a variable declared with const or let?
block scope
What is the difference between let and const?
const is immutable
Why is it possible to .push() a new value into a const variable that points to an Array?
The const keyword ensures that the variable it creates is read-only. However, it doesn’t mean that the actual value to which the const variable reference is immutable.
How should you decide on which type of declaration to use?
If you are planning to change the value of the variable or not
What is the syntax for writing a template literal?
using backticks
What is “string interpolation”?
substituting parts of the string for values or variables
What is destructuring, conceptually?
taking properties and assigning them to variables
What is the syntax for Object destructuring?
let {propertyName : variableName} = object
What is the syntax for Array destructuring?
let [variable1, variable2] = Array
How can you tell the difference between destructuring and creating Object/Array literals?
use of let/const in defining variables. structuring
What is the syntax for defining an arrow function?
let add = (x, y) => x + y;
When an arrow function’s body is left without curly braces, what changes in its functionality?
implicit return vs explicit return
How is the value of this determined within an arrow function?
Unlike an anonymous function, an arrow function captures the this value of the enclosing context instead of creating its own this context.
What is a CLI?
command line interface
What is a GUI?
graphical user interface
ive at least one use case for each of the commands listed in this exercise. man cat ls pwd echo touch mkdir mv rm cp
man- manual look up man man cat-show contents of file cat -a ls- list out files pwd- print current directory echo-log to directory or put text into file touch-create new file mkdir- make new directory mv- rename file rm- remove file cp-copy contents of file to another file
What are the three virtues of a great programmer?
adaptability, recognition, diligence
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser.
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user
When was Node.js created?
2009
What back end languages have you heard of?
C#, python, Ruby
What is a computer process?
process is the instance of a computer program that is being executed by one or many threads. It contains the program code and its activity.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
40