(required) Q: Describe the difference in result of the JavaScript DOM methods getElementById and getElementsByClassName.
2. (required) Given this JavaScript statement:
objXHR.open('GET',' HYPERLINK "http://" http://myURL.com',true);
a. Q: What, probably, is the type of the object named "objXHR"?
b. Q: What is the purpose of each of the parameters being passed to the "open" method?
Q: If an absolute URL is passed in the second argument, what kind of restriction usually applies?
3. (required) How would you (a) declare and then (b) instantiate a JavaScript class to describe a "Square" object, taking one argument in its constructor? The instance of a Square should have sides 4 units in length. ( c )What properties might a Square object have and how would they be coded?
a. declare: function Square(numericSideArgument) {
... (some other stuff)
}
b. use: var mySquare = new Square(4);
c. methods: perimeter, coded as "this.perimeter = numericSideArgument * 4;"
area, coded as "this.area = numericSideArgument ^ 2;" (squared, i.e. width * height)
So, the whole definition of Square would be:
function Square(numericSideArgument) {
this.perimeter = numericSideArgument * 4;
this.area = numericSideArgument ^ 2;
return this;
}
So, Q: "mySquare.perimeter" would equal?
Q: "mySquare.area" would equal ?
4. (desired) An object called "auto" has an "id" attribute with value of "taurus" and a "color" attribute with value "blue". Additionally, it has a child object "radio", which contains an array "knob" which contains three items with names and shapes:
name: power, shape: round
name: tune, shape: oval
name: scan, shape: square
Q: What does the acronym JSON stand for?
Q: What does this object look like in JSON?
BONUS 5. (CSS-related) Describe the difference between a <DIV> element versus a <SPAN>.
BONUS 6. (Advanced JavaScript and YUI) If I have a JavaScript collection object "YAHOO.util.Dom" with a member method "setStyle" that takes three arguments
"an array of element id's"
"a css property name", and
"a single float value",
...Q: how would I write the single line of JavaScript that sets the transparency of DIV's "layer1" and "layer2" to "66%"?
Q: How would I write the single line of JavaScript that sets the background color of only DIV "layer1" to hexadecimal "black"?
Q: If there was another method which DID take a single-value, non-array, in that first argument, in object-oriented terminology, the method would be said to be "what"?
Q: Does JavaScript support overloading?
BONUS 7: (Super-impressive) Q: Can you summarize the definition of "JavaScript enclosures"?
No comments:
Post a Comment