Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Which is the function used to loop in an array to view all the values?(a) all()(b) loop()(c) each()(d) every()The question was asked in an online quiz.My question is taken from Comparison of Core JavaScript versus Frameworks topic in division Caching, Debugging and Animation of JavaScript

Answer»

Correct OPTION is (c) each()

To EXPLAIN I WOULD say: for.each() function is used for traversing through each VALUES of the array. The METHOD jQuery.each(array, function) loops through the array.

2.

Which of the following is not an object?(a) Element(b) Location(c) Position(d) WindowThis question was addressed to me in an interview.My query is from Comparison of Core JavaScript versus Frameworks topic in division Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (C) Position

The explanation: The window OBJECT represents an OPEN window in a BROWSER. There is no object called Position.

3.

Which class provides an interface for invoking JavaScript methods and examining JavaScript properties?(a) ScriptObject(b) JSObject(c) JavaObject(d) JobjectThe question was posed to me in a national level competition.This interesting question is from Comparison of Core JavaScript versus Frameworks in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct OPTION is (b) JSObject

Explanation: JSObject is the type of JavaScript objects in the JSAPI. When a JavaScript object is passed or returned to Java CODE, it is wrapped in an instance of JSObject. When a JSObject instance is passed to the JavaScript engine, it is unwrapped back to its original JavaScript object. The JSObject class PROVIDES a way to invoke JavaScript METHODS and EXAMINE JavaScript properties.

4.

Which is a wrapped Java array, accessed from within JavaScript code?(a) JavaArray(b) JavaClass(c) JavaObject(d) JavaPackageThe question was posed to me during a job interview.Asked question is from Comparison of Core JavaScript versus Frameworks topic in section Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT CHOICE is (a) JavaArray

Explanation: JAVA array is an object which contains elements of a similar data type. JavaArray is ACCESSED from within JavaScript CODE.

5.

Which of the following has a greater benchmark time for looping and JQuery vs core JavaScript in milliseconds?(a) Chrome JQuery(b) Chrome JavaScript(c) Firefox JQuery(d) Firefox JavaScriptThis question was posed to me in a national level competition.My query is from Comparison of Core JavaScript versus Frameworks in section Caching, Debugging and Animation of JavaScript

Answer»

The correct CHOICE is (a) Chrome JQuery

To explain: jQuery Injector allows you to INJECT jQuery into every frame on a page so that you can use jQuery in the chrome DEV console. When we try to compare the average benchmark time for looping and JQuery vs core JavaScript in MILLISECONDS, the Chrome JQuery has a greater benchmark time.

6.

What kind of error notifications are shown in the console window?(a) Syntax error(b) Runtime error(c) Both Syntax error and Runtime error(d) Compilation errorThe question was posed to me in an interview for job.I'm obligated to ask this question of Forms of Debugging topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (c) Both Syntax error and Runtime error

For EXPLANATION: The BROWSERS like Firefox, Netscape and Mozilla send error messages to a special window called the JavaScript CONSOLE or Error Console. Error notifications that show up on Console or through Internet Explorer DIALOG boxes are the result of both syntax and runtime ERRORS. These error notification include the line number at which the error occurred.

7.

Which of the following is not a JavaScript framework?(a) Rico(b) Prototype(c) Joco(d) DoJoI had been asked this question in exam.My query is from Comparison of Core JavaScript versus Frameworks topic in division Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (d) DoJo

Easy EXPLANATION: Dojo Toolkit is an OPEN source MODULAR JavaScript library (or more SPECIFICALLY JavaScript toolkit) designed to ease the rapid DEVELOPMENT of cross-platform, JavaScript/Ajax-based applications and web sites. Rico was an open-source JavaScript library for developing rich internet applications with Ajax.

8.

What is the framework?(a) User time efficiency(b) Author time efficiency(c) Both User time and Author time efficiency(d) Client time efficiencyI got this question by my college professor while I was bunking the class.Query is from Comparison of Core JavaScript versus Frameworks topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (b) Author time efficiency

For explanation I would SAY: A FRAMEWORK, or software framework, is a platform for developing software applications. Frameworks are an author-time efficiency, MEANING that they make coding tasks MUCH simpler by ABSTRACTING the real work that goes into doing those tasks.

9.

What is the syntax of close method for document object?(a) Close(object)(b) Close(doc)(c) Close(val)(d) Close()This question was posed to me by my college director while I was bunking the class.Query is from Comparison of Core JavaScript versus Frameworks topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Right CHOICE is (d) Close()

The best EXPLANATION: In order to close a document object, we NEED to CALL Close(). In order to close a document object, we need to call Close().

10.

Which of the following is the window that the Firefox sends the error messages to?(a) Bug Window(b) Error Issues(c) Error Window(d) Error ConsoleThis question was posed to me during an internship interview.My enquiry is from Forms of Debugging topic in section Caching, Debugging and Animation of JavaScript

Answer»

The correct OPTION is (d) Error Console

Explanation: The browsers like Firefox, Netscape and Mozilla send error MESSAGES to a SPECIAL window CALLED the JavaScript Console or Error Console. The Error Console is deprecated in Firefox and is now only made available if you SET the devtools.errorconsole.enabled preference to true.

11.

Which of the following are static methods in JavaScript?(a) Date.parse()(b) Date.UTC()(c) Both Date.parse() and Date.UTC()(d) Date.clear()I had been asked this question in an interview for job.The origin of the question is Comparison of Core JavaScript versus Frameworks in division Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (c) Both Date.parse() and Date.UTC()

To EXPLAIN I would say: Date objects are created with the NEW Date() constructor. Date.parse() parses a STRING representation of a date and time and returns the internal MILLISECOND representation of that date. Date.UTC() Returns the millisecond representation of the specified UTC date and time.

12.

What is the other way of calling the Error Console in Firefox?(a) Error Window(b) JavaScript Console(c) JavaScript Window(d) Error or JavaScript WindowI got this question by my school teacher while I was bunking the class.This intriguing question comes from Forms of Debugging topic in chapter Caching, Debugging and Animation of JavaScript

Answer» RIGHT OPTION is (b) JavaScript CONSOLE

The explanation: The BROWSERS like Firefox, Netscape and Mozilla SEND error messages to a special window called the JavaScript Console or Error Console. The Error Console is also termed as the JavaScript Console.
13.

How do you find the number with the highest value of x and y?(a) ceil(x,y)(b) top(x,y)(c) Math.ceil(x,y)(d) Math.max(x,y)I had been asked this question during an interview.This interesting question is from Comparison of Core JavaScript versus Frameworks topic in section Caching, Debugging and Animation of JavaScript

Answer»

Right OPTION is (d) Math.MAX(x,y)

To ELABORATE: max FUNCTION is used for comapring and finding maximum values. It is found in the math library. Math.max(x,y) is used to find the highest value of x and y.

14.

What is the procedure to view the console in the Firefox?(a) Tools -> Error Console(b) Tools -> Error Window(c) Help -> Error Console(d) Tools -> Bug windowThe question was posed to me in an internship interview.My doubt stems from Forms of Debugging in portion Caching, Debugging and Animation of JavaScript

Answer» CORRECT choice is (a) Tools -> Error Console

The BEST I can EXPLAIN: The error icon OPTION can be enabled in the Tools. To view the console, select Tools –> Error Console or Web Development.
15.

Which of the following is the definition for debugging?(a) Finding bugs(b) Fixing bugs(c) Both Finding & Fixing bugs(d) Clearing bugsI had been asked this question by my school principal while I was bunking the class.My question comes from Forms of Debugging in portion Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (c) Both Finding & FIXING bugs

Explanation: Debugging is the process of finding and RESOLVING DEFECTS or PROBLEMS within a computer program that prevent correct operation of computer software or a system. The process of finding and fixing bugs is called debugging and is a normal part of the development process.

16.

How many static methods does a Date object have?(a) 3(b) 5(c) 4(d) 2This question was addressed to me in a national level competition.The origin of the question is Comparison of Core JavaScript versus Frameworks in section Caching, Debugging and Animation of JavaScript

Answer» CORRECT choice is (d) 2

Easiest explanation: Date OBJECTS are CREATED with the NEW Date() constructor. The Date object defines TWO static methods namely Date.parse() and Date.UTC().
17.

What is the purpose of the function eval?(a) Executes the string as an integer(b) Gets the value of the string(c) Executing string as JavaScript(d) Executing string as an objectI have been asked this question in a national level competition.My enquiry is from Comparison of Core JavaScript versus Frameworks in section Caching, Debugging and Animation of JavaScript

Answer»

Right answer is (C) Executing string as JAVASCRIPT

The best I can EXPLAIN: EVAL is a JavaScript native function that accepts a string and executes the string as JavaScript. The argument of the eval() function is a string. It basically fires up the interpreter and allows the passed-in string to be PARSED and interpreted at the time of invocation.

18.

How do we debug a script?(a) Use of JavaScript Validator(b) Use of JavaScript Debugger(c) Use of JavaScript Validator & Debugger(d) Use of javascript interpreterI had been asked this question in an interview for internship.Question is taken from Forms of Debugging topic in section Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (c) Use of JAVASCRIPT Validator & Debugger

Explanation: Both the JavaScript Validator and the JavaScript Debugger can be used to debug a script. The debugger STATEMENT stops the execution of JavaScript, and calls (if AVAILABLE) the debugging FUNCTION.

19.

Which of the following is not a navigator method?(a) postEnabled(b) reference(c) preference(d) postreferenceThis question was addressed to me in an interview for internship.I need to ask this question from Image Map topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right answer is (c) preference

The BEST explanation: The preference(name, value) method allows a signed script to GET and SET some Netscape preferences. If the SECOND parameter is OMITTED, this method will return the value of the specified preference; otherwise, it sets the value Netscape only.

20.

What is it called when we make a mistake in the script?(a) Error(b) Bug(c) Mistake(d) DebugThe question was posed to me by my school principal while I was bunking the class.Question is taken from Forms of Debugging in portion Caching, Debugging and Animation of JavaScript

Answer»

Right option is (B) Bug

To ELABORATE: A bug in a programming LANGUAGE REFERS to a SET of code which results in an error in compilation. A mistake in a script is referred to as a bug.

21.

If we have an object r and want to know if it is a Range object, we can write ______________(a) r typeof Range(b) r is Range(c) r equals Range(d) r instanceof RangeThis question was posed to me during an interview.I want to ask this question from Comparison of Core JavaScript versus Frameworks topic in division Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (d) r instanceof Range

Explanation: To know the range OBJECT r instanceof range is used. The r instanceof Range RETURNS true if r INHERITS from Range.prototype. The instanceof operator does not ACTUALLY check whether r was initialized by the Range CONSTRUCTOR.

22.

Where is the error icon option available?(a) Tools(b) Help(c) File(d) EditThis question was posed to me in my homework.Query is from Forms of Debugging topic in section Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT choice is (a) TOOLS

The explanation: The error icon option can be enabled in the Tools. To view the CONSOLE, select Tools –> Error Consol or WEB DEVELOPMENT.

23.

What is the purpose of the preference method in a navigator?(a) Set Browser preference(b) Set Netscape preference(c) Both Set Browser & Netscape preference(d) Sets user preferenceThis question was addressed to me in final exam.The query is from Image Map in portion Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (b) Set Netscape preference

Best explanation: The preference(name,value) method allows a signed script to get and set some Netscape PREFERENCES. If the SECOND parameter is OMITTED, this method will RETURN the value of the SPECIFIED preference; otherwise, it sets the value Netscape only.

24.

Which of the following has a lesser benchmark time for using JQuery to access DOM versus pure JavaScript in milliseconds?(a) Chrome JQueryDOM_(b) Chrome JSDOM_benc(c) Firefox JQueryDOM_(d) Firefox JSDOM_bencThis question was addressed to me during an interview.This question is from Comparison of Core JavaScript versus Frameworks topic in section Caching, Debugging and Animation of JavaScript

Answer»

Correct OPTION is (d) Firefox JSDOM_benc

The explanation: jsdom is a pure-JavaScript implementation of many web STANDARDS, notably the WHATWG DOM and HTML Standards, for use with Node.js. When we try to compare the average benchmark time for USING JQuery to access DOM versus pure JavaScript in MILLISECONDS, the Firefox JSDOM_benc has a lesser benchmark time.

25.

What is the property to access the first child of a node?(a) timestamp.Child1(b) timestamp.Child(1)(c) timestamp.Child(0)(d) timestamp.firstChildThis question was posed to me in an international level competition.This is a very interesting question from Comparison of Core JavaScript versus Frameworks in division Caching, Debugging and Animation of JavaScript

Answer» CORRECT choice is (d) timestamp.firstChild

To elaborate: The firstChild property RETURNS the first CHILD node of the SPECIFIED node, as a Node object. The first child of a node can be ACCESSED using the firstChild property.
26.

What is the purpose of the Math method toSource()?(a) Returns the string “Math”(b) Sends the source to the Math Library(c) Returns the value of the object(d) Returns an integer valueI have been asked this question in unit test.The origin of the question is Comparison of Core JavaScript versus Frameworks in portion Caching, Debugging and Animation of JavaScript

Answer»

Right option is (a) Returns the string “Math”

BEST explanation: The method Math.TOSOURCE() returns the string “Math”. But this method does not WORK with many browsers like IE. The toSource() method returns a string representing the SOURCE code of the object.

27.

Where is the error icon shown in the Internet Explorer?(a) Taskbar(b) Status bar(c) Both Taskbar and Status bar(d) Bookmarks barThis question was addressed to me in class test.This intriguing question originated from Forms of Debugging topic in division Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT answer is (b) Status bar

The explanation: The error icon option can be enabled in the Tools. To view the console, SELECT Tools –> Error CONSOL or Web Development.

28.

What is the purpose of the platform[] property in a navigator?(a) Platform of the script(b) Platform where the image map was designed(c) Platform where the browser was compiled(d) Platform where the plugin was designedThe question was posed to me in unit test.My question is taken from Image Map topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT answer is (c) Platform where the browser was COMPILED

Explanation: The platform[] property is a string that CONTAINS the platform for which the browser was compiled. “WIN32” for 32-bit Windows operating systems.

29.

How are the objects organized in the HTML DOM?(a) Class-wise(b) Queue(c) Hierarchy(d) StackI got this question in final exam.This interesting question is from HTML DOM topic in section Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT choice is (c) Hierarchy

To EXPLAIN I WOULD say: The HTML DOM model is constructed as a tree of OBJECTS. The objects are organized in the hierarchy format in the HTML DOM.

30.

Which of the following ensures additional interactivity mechanism?(a) WAI ARIA(b) Geolocation API(c) Object API(d) SDL APIThis question was posed to me in examination.The above asked question is from HTML APIs in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (a) WAI ARIA

For explanation: Web ACCESSIBILITY INITIATIVE – Accessible Rich Internet Applications (WAI-ARIA) is a technical specification published by the World Wide Web Consortium (W3C) that specifies how to increase the accessibility of web pages, in particular, DYNAMIC content, and user interface components developed with Ajax, HTML, JavaScript, and related technologies. WAI ARIA offers mechanisms to ensure that this additional interactivity remains usable independent of DEVICES and disabilities.

31.

Which database can be used to retrieve blobs?(a) Server-side databases(b) Client-side databases(c) Both Server-side and Client-side databases(d) Temporary databasesI got this question by my college director while I was bunking the class.This intriguing question comes from Blobs in JavaScript topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT option is (B) Client-side databases

Best explanation: A Blob object represents a file-like object of immutable, RAW data. Blobs REPRESENT data that isn’t necessarily in a JavaScript-native format. Blobs can be retrieved from client-side databases.

32.

Which program code doesn’t need preprocessing before being run?(a) Text(b) Script(c) Both Text and Script(d) CommentThe question was asked in an interview for internship.This question is from HTML APIs in division Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT option is (b) Script

The best I can explain: A scripting or script language is a PROGRAMMING language for a special RUN-time environment that automates the execution of tasks. A script is program CODE that doesn’t need pre-processing (e.g. COMPILING) before being run.

33.

Which method facilitates in uploading a Blob to a server?(a) send()(b) pass()(c) upload()(d) store()The question was asked in exam.The question is from Blobs in JavaScript topic in section Caching, Debugging and Animation of JavaScript

Answer»

Right option is (a) send()

Explanation: The BLOB() constructor ALLOWS one to create BLOBS from other objects. You can upload a Blob to a SERVER by passing it to the send() method of an XMLHttpRequest object.

34.

BLOB stands for ______________(a) Binary Little Object(b) Binary Large Object(c) Broken Large Object(d) Binary Small objectThis question was addressed to me in homework.This interesting question is from Blobs in JavaScript topic in division Caching, Debugging and Animation of JavaScript

Answer»

Right option is (b) Binary Large Object

For explanation I would say: A Blob is an opaque REFERENCE to, or handle for, a chunk of data. The name comes from SQL databases, where it means “Binary Large Object.” In JAVASCRIPT, Blobs often represent binary data, and they can be large, but neither is required: a Blob could also represent the contents of a SMALL TEXT file.

35.

Which property is used to manage multiple event handlers?(a) onmessage(b) onerror(c) both onmessage and onerror(d) postmessageI had been asked this question during an internship interview.The origin of the question is Web Workers topic in section Caching, Debugging and Animation of JavaScript

Answer» RIGHT answer is (c) both onmessage and onerror

The best I can explain: message event is fired when the worker’s parent RECEIVES a message from its worker which is also available via the onmessage PROPERTY. You can use onmessage and onerror PROPERTIES if you want to manage multiple event handlers.
36.

Why shouldn’t JavaScript functions not be too long?(a) User friendliness(b) Tie up event loops(c) Browser becomes unresponsive(d) All of the mentionedI got this question in final exam.The above asked question is from Web Workers topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right option is (d) All of the mentioned

Easy EXPLANATION: When JavaScript code RUNS for longer than a predefined amount of time than the browser shows a message of unresponsive SCRIPT. The client-side JavaScript functions must not RUN too long: otherwise, they will tie up the event loop and the web browser will become unresponsive to user INPUT.

37.

Which is the attribute used to enable the Client-side image map?(a) map(b) area(c) usemap(d) areamapThe question was posed to me during an interview for a job.Question is taken from Image Map in chapter Caching, Debugging and Animation of JavaScript

Answer»

Correct ANSWER is (c) USEMAP

The best I can EXPLAIN: The usemap ATTRIBUTE is associated with a ELEMENT’s name or id attribute, and creates a relationship between the and the .

38.

Which function is used to clear the timer value?(a) clearTimervalue()(b) clearTimeout()(c) clear()(d) flush(timer)The question was posed to me during an interview for a job.This interesting question is from Animation in division Caching, Debugging and Animation of JavaScript

Answer»

The correct CHOICE is (b) clearTimeout()

Best explanation: The clearTimeout() METHOD clears a timer SET with the setTimeout() method. The ID value returned by setTimeout() is used as the parameter for the clearTimeout() method.

39.

Which of the following is a type of HTML DOM?(a) Legacy DOM(b) W3C DOM(c) IE4 DOM(d) All of the mentionedI got this question in homework.This interesting question is from HTML DOM in division Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (d) All of the mentioned

Best explanation: IE4 DOCUMENT object model was introduced in Version 4 of Microsoft’s INTERNET Explorer browser. IE 5 and later VERSIONS include support for most basic W3C DOM features. All of the above mentioned are TYPES of HTML DOM.

40.

What is the purpose of the RegExp method test()?(a) Tests for a match in its float parameter(b) Tests for a match in its string parameter(c) Tests for a match in its integer parameter(d) Test for a match in nodeThe question was posed to me in an internship interview.I want to ask this question from External JavaScript and PHP topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Right OPTION is (b) Tests for a match in its STRING parameter

Easy explanation: RegExp stands for regular EXPRESSION which is an object that describes a pattern of CHARACTERS.

41.

How can you send data using a Worker object?(a) postMessage()(b) sendMessage()(c) Message()(d) post()I have been asked this question in examination.My question is based upon Web Workers in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (a) POSTMESSAGE()

The best I can explain: Once you have a Worker object, you can SEND data to it with postMessage(). The value you pass to postMessage() will be cloned, and the resulting COPY will be delivered to the worker via a message event. postMessage() sends a message — which can CONSIST of any JavaScript object — to the worker’s inner scope.

42.

Which of the following is a global object for a new worker?(a) WorkerGlobalScope(b) Worker(c) WorkerScope(d) WindowI got this question in an internship interview.The above asked question is from Web Workers in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (a) WorkerGlobalScope

The EXPLANATION is: A web WORKER is a JavaScript that runs in the background, independently of other scripts, WITHOUT affecting the performance of the page. The WorkerGlobalScope is the global object for a new worker, and it is what a worker THREAD looks LIKE, on the inside, to itself.

43.

What is a closure compiler UI?(a) Run time application(b) Web application(c) Standalone application(d) Changes structuresThis question was posed to me in an internship interview.My question comes from The Closure Compiler topic in division Caching, Debugging and Animation of JavaScript

Answer»

Correct OPTION is (b) WEB application

Explanation: The Closure Compiler is a TOOL for making JavaScript download and RUNS faster. Instead of compiling from a source language to machine CODE, it compiles from JavaScript to better JavaScript. A closure compiler UI is a web application.

44.

Which are the special tags used for image mapping?(a) map and area(b) map and usemap(c) only map(d) only usemapThis question was posed to me during an interview.I need to ask this question from Image Map in division Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (a) map and area

Easy explanation: The usemap ATTRIBUTE specifies an IMAGE (or an object) as an image-map (an image-map is an image with clickable AREAS). The special tags USED for image mapping are map and area.

45.

What is the purpose of data format validation?(a) Data correctness(b) Mere data existence(c) Both Data correctness and Mere data existence(d) Data modificationThis question was posed to me during an online interview.Origin of the question is Validation in division Caching, Debugging and Animation of JavaScript

Answer»

Correct OPTION is (a) Data correctness

For explanation: The data entered through the server SIDE is used for validation. The data that is entered must be CHECKED for correct form and value. This would need to PUT more logic to test the correctness of data.

46.

How to assign the image source in JavaScript?(a) image = “url”(b) source(“url”)(c) image.src = “url”(d) img.src=”url”The question was asked by my college professor while I was bunking the class.My query is from Animation topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (c) IMAGE.src = “URL

The BEST explanation: For accesing any image in WEBPAGE its address or url is specified. The image SOURCE is defined as image.src = “/images/html.gif”.

47.

Which is the property used to position the object in the left of the screen?(a) object.position = left(b) object = position.left(c) object.style.left(d) object.shiftleftThe question was asked by my school principal while I was bunking the class.This interesting question is from Animation topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct choice is (c) object.style.left

To explain: The property object.style.left = distance in pixels or points sets distance from left EDGE of the screen. This property SPECIFIES the left position of the element including padding, scrollbar, BORDER and margin. Whereas the setTimeout(FUNCTION, duration) calls function after duration milliseconds from now.

48.

When does one use the event ready?(a) Before loading(b) During loading(c) After loading(d) During reloadingThe question was asked by my school teacher while I was bunking the class.My enquiry is from HTML APIs in portion Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT answer is (C) After loading

Explanation: The READY EVENT occurs when the DOM (document object MODEL) has been loaded. It is safe to interact with it after this event fired.

49.

What is the purpose of the event disconnectionEvent?(a) Player demands for disconnection(b) Player disconnects from the channel(c) There is no user interaction(d) Player demands for reconnectionThe question was posed to me in an online quiz.Question is from HTML APIs in chapter Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (b) Player DISCONNECTS from the channel

To EXPLAIN I WOULD say: navigator.onLine is a property that maintains a true/false value (true for online, false for offline). This property is updated whenever the user switches into “Offline MODE”. The EVENT disconnectionEvent is fired when the player disconnects from the channel, whether a result of user interaction or not.

50.

What is the significance of scripting?(a) Convenient(b) Dynamic(c) Reachable(d) ModularI have been asked this question in examination.The origin of the question is HTML APIs topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (b) Dynamic

Easiest explanation: Scripting languages are often interpreted (rather than compiled). Scripting makes Web pages more dynamic) For example, WITHOUT reloading a new VERSION of a page it MAY allow modifications to the content of that page, or allow content to be ADDED to or sent from that page. The former has been called DHTML (Dynamic HTML), and the latter AJAX (Asynchronous JAVASCRIPT and XML).