⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 questions.js

📁 Javascript语言开发经典教程开发
💻 JS
📖 第 1 页 / 共 2 页
字号:
// For construction new question objects
function question(answer, support, question, a, b, c, d) {
	this.answer = answer;
	this.support = support;
	this.question = question;
	this.a = a;
	this.b = b; 
	this.c = c;
	this.d = d;
	return this;
	}

// The array of questions, answers, options, and explanations
var units = new Array(
	new question("b", "The <FONT FACE=Courier>body</FONT> property is completely contrived. All the others are valid.", "Choose the property that does not belong to the Mail Message object for Netscape Messenger:", "folder", "body", "read", "priority"),
	new question("c", "Methods <FONT FACE=Courier>trash()</FONT> and <FONT FACE=Courier>killThread()</FONT> seem likely candidates, but the culprit is actually <FONT FACE=Courier>filter()</FONT>", "Choose the method that does not belong to the Mail Message object for Netscape Messenger:", "killThread()", "watchThread()", "filter()", "trash()"),
	new question("a", "When you call a dialog box, the current window loses focus. As soon as you choose a dialog button such as <FONT FACE=Courier>OK</FONT> or <FONT FACE=Courier>Cancel</FONT>, the dialog box will be recalled..... ad infinitum.", "Which of the following is a known JavaScript bug?", "Using window.alert, window.confirm or window.prompt inside onFocus handlers can cause infinite loops", "Using window.alert, window.confirm or window.prompt inside onBlur handlers can cause infinite loops", "Using window.alert, window.confirm or window.prompt inside onLoad handlers can cause infinite loops", "Using window.alert, window.confirm or window.prompt inside onFocus handlers can cause infinite loops"),
	new question("a", "<FONT FACE=Courier>link()</FONT> arrived in 1.0; <FONT FACE=Courier>split()</FONT> and <FONT FACE=Courier>join()</FONT> showed up in 1.1", "Select the method added in JavaScript 1.2:", "concat()", "link()", "split()", "join()"),
	new question("b", "<FONT FACE=Courier>slice()</FONT> came about in version 1.2", "Select the method not supported by JavaScript 1.1:", "sort()", "slice()", "split()", "reverse()"),
	new question("b", "All the rest came about in 1.1", "Select the feature added in JavaScript 1.0:", "lowsrc", "link()", "split()", "join()"),
	new question("c", "The <FONT FACE=Courier>Function</FONT> constructor must evaluate its arguments each time it is called. This slows things a bit.", "What is one disadvantage of using the Function constructor?", "Scripts can use it to create functions at run time", "It conveniently defines small functions", "Functions defined this way are not compiled and execute slower", "There is no reason not to use it"), 
	new question("d", "<FONT FACE=Courier>arguments</FONT> is an array containing the arguments passed. <FONT FACE=Courier>arity</FONT> returns the number of arguments expected. <FONT FACE=Courier>caller</FONT> identifies the calling function.", "Which doesn't belong to the Function constructor?", "arguments", "arity", "caller", "id"),
	new question("c", "<FONT FACE=Courier>find()</FONT> accepts zero, one, or three arguments, but not two.", "Choose the bogus call to the find() method:", "find()", "find(string)", "find(string, matchcase)", "find(string, matchcase, backward)"),
	new question("b", "This property identifies plug-in paths.", "Which object is the proud owner of the filename property:", "document", "Plugin", "FileUpload", "Window"),
	new question("a", "You must use the same &; notation as you do for HTML character entities.", "Which is the proper syntax for using JavaScript entities?", "&lt;TD WIDTH=&{myVar};>", "&lt;TD WIDTH=100>The answer is &{myVar}&lt;/TD>", "&lt;&{myVar} WIDTH=100>", "All of them are fine"), 
	new question("a", "<FONT FACE=Courier>id</FONT> is the object property to monitor. <FONT FACE=Courier>handler</FONT> identifies the function to call when <FONT FACE=Courier>id</FONT> changes.", "Which is the correct syntax for the watch() method?", "watch(id, handler)", "watch(handler, id)", "watch(id)", "watch(handler)"), 
	new question("c", "These properties were replaced by <FONT FACE=Courier>outerWidth</FONT> and <FONT FACE=Courier>outerHeight</FONT>, respectively.", "Choose the properties that have been deprecated as of JavaScript 1.2", "window.width", "window.height", "Both a and b", "Neither a nor b"),
	new question("d", "All of them would become true by exchanging <I>Double</I> for <I>Float</I>, <I>stay wrapped</I> for <I>become unwrapped</I>, and <I>unwrapped</I> for <I>wrapped</I>. Kind of dirty, huh?", "Think LiveConnect. Which is true of data type conversion for values passed from JavaScript to Java?", "Strings, numbers and booleans are converted to Java String, Double, and Boolean objects", "Objects that are wrappers around Java objects stay wrapped", "Other objects are unwrapped with a JSObject", "Something stinks. I say they're all wrong"), 
	new question("c", "The comma operator would evaluate the second expression.", "Consider the following array:<BR><BR>var opposites = new Array(new Array('Day', 'Night'),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Array('Good', 'Evil'),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Array('Right', 'Wrong')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<BR><BR>What does the following print? <BR><BR>document.write(opposites[1,2]);", "['Right', 'Wrong']", "['Day', 'Night']", "Wrong", "undefined"),
	new question("c", "Technically, <FONT FACE=Courier>with</FONT> is a JavaScript reserved word used in statements.", "Which of the following is not an operator?", "comma", "ternary", "with", "void"),
	new question("c", "When using bitwise operators to evaluate multiple expressions (e.g., <FONT FACE=Courier>(i > 6 & g < 7)</FONT> ), if the first is false, the remaining expressions are not evaluated.", "Which uses short-circuit evaluation?", "watch()", "unwatch()", "bitwise operators", "assignment operators"),
	new question("d", "Microsoft Internet Explorer 4.x supports the <FONT FACE=Courier>document.all</FONT> object. Netscape Navigator does not.", "Which might you use for browser detection?", "document.location", "document.domain", "document.layer", "document.all"),
	new question("a", "The <FONT FACE=Courier>watch()</FONT> method in a sense owns its own thread, and does monopolize other processes.", "What is arguably the most resource-efficient way to monitor an object property until it has changed?", "watch()", "setTimeOut()", "setInterval()", "a while loop"),
	new question("d", "This will strap your processing power in the browser, and not free it up until the object property has changed.", "What is arguably the most resource-inefficient way to monitor an object property until it has changed?", "watch()", "setTimeOut()", "setInterval()", "a while loop"),
	new question("d", "<FONT FACE=Courier>void</FONT> has the syntax of a method or function, but it is an operator.", "Which best describes <I>void</I>?", "A method", "A function", "A statement", "An operator"),
	new question("a", "Object signing requires the the signature and other files be stored in a Java Archive (JAR) file.", "Which JavaScript feature uses JAR files?", "Object signing", "Style sheets", "Netcaster channels", "Image rollovers"),
	new question("d", "The <FONT FACE=Courier>charAt()</FONT> method of the <FONT FACE=Courier>String</FONT> object is supported in JavaScript 1.0, which MSIE 3.x supports.", "Which feature is supported in MSIE 3.x?", "split()", "Image()", "join()", "charAt()"),
	new question("a", "If you do not set the <FONT FACE=Courier>expires</FONT> attribute, the cookie expires at the end of the browser session.", "What's the default setting for the <I>expires</I> attribute of the document.cookie property?", "The duration of the browser session.", "The duration the current document stays loaded.", "Twenty-four hours from the time the cookie is set.", "There is no default setting."),
	new question("a", "The <FONT FACE=Courier>onKeyDown</FONT> event must first return true before the <FONT FACE=Courier>onKeyPress</FONT> event will be considered.", "Which of the following is true?", "If onKeyDown returns false, the key-press event is cancelled.", "If onKeyPress returns false, the key-down event is cancelled.", "If onKeyDown returns false, the key-up event is cancelled.", "If onKeyPress returns false, the key-up event is canceled."),
	new question("c", "JavaScript employs prototype-based inheritance, which helps qualify it as an object-oriented language.", "Which is true of JavaScript?", "JavaScript is not object oriented", "JavaScript employs class-based inheritance", "JavaScript employs prototype-based inheritance", "JavaScript supports pointers"),
	new question("c", "The <FONT FACE=Courier>FileUpLoad</FONT> object belongs to client-side JavaScript", "Choose the server-side JavaScript object:", "FileUpLoad", "Function", "File", "Date"),
	new question("d", "The <FONT FACE=Courier>File</FONT> object belongs to server-side JavaScript.", "Choose the client-side JavaScript object:", "Database", "Cursor", "Client", "FileUpLoad"),
	new question("a", "Though the same <FONT FACE=Courier>setTimeout()</FONT> method can be called multiple times, it only runs its statements once.", "Seek the truth about setTimeout():", "The statement(s) it executes run(s) only once.", "It pauses the script in which it is called.", "clearTimeOut() won't stop its execution.", "The delay is measured in hundredths of a second."),
	new question("b", "The other three are either read-only or bogus.", "What property would you use to redirect a visitor to another page?", "document.URL", "window.location.href", ".document.location.href", "link.href"),
	new question("c", "<FONT FACE=Courier>getSelection()</FONT> returns a copy of the text you have highlighted.", "Which best explains getSelection()?", "Returns the VALUE of a selected OPTION.", "Returns document.URL of the window in focus.", "Returns the value of cursor-selected text.", "Returns the VALUE of a checked radio input."),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -