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.

51.

When does a cycle occur during memory leak?(a) No reference occurs(b) Two objects reference(c) One object gets referenced(d) Three object gets referencedThe question was posed to me in a national level competition.I want to ask this question from JavaScript and Memory Leak in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (b) Two objects reference

To ELABORATE: Old versions of Internet EXPLORER COULD not detect cyclic references between DOM NODES and JavaScript code. A cycle happens when two objects reference each other in such a way that both objects retain each other.

52.

What are the two parts of JavaScript libraries?(a) “script” tag and “body” tag(b) External JavaScript and the“script” tag(c) “html” tag and “body” tag(d) ”html” and “style” tagThe question was asked in an online interview.This is a very interesting question from External JavaScript and PHP topic in division Caching, Debugging and Animation of JavaScript

Answer» RIGHT answer is (b) External JavaScript and the“script” tag

Explanation: All JavaScript libraries consists of two parts:

The external JavaScript itself, which is SIMPLY a text FILE with the containing JavaScript code, saved as a .js file.

A “script” tag referencing the external JavaScript file and DEFINED on the page(s) that uses the library.

The
53.

What is the purpose of destroying the functions and objects?(a) Consume unnecessary CPU cycles(b) Prevent the dropping of reference count to 0(c) Centralize the responsibility to clean up(d) All of the mentionedI have been asked this question in an interview for internship.This intriguing question originated from JavaScript and Memory Leak topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct ANSWER is (d) All of the mentioned

Easy explanation: The primary purpose of a destroy FUNCTION is to centralize the responsibility for cleaning up anything that the object has done that will:

Prevent its reference count from dropping to 0 (for example, REMOVING problematic event listeners and callbacks and unregistering from any services).

Consume unnecessary CPU cycles, such as INTERVALS or ANIMATIONS.

54.

What will happen if you specify an absolute URL in the Worker constructor?(a) Resolves itself(b) Must have the same origin(c) Must not have the same origin(d) Specify the addressThis question was posed to me during an interview.My doubt stems from Web Workers in portion Caching, Debugging and Animation of JavaScript

Answer»

Right ANSWER is (b) Must have the same origin

The best explanation: If you specify an ABSOLUTE URL, it must have the same origin (same protocol, host, and port) as that containing document. In Firefox, if you WANT to use workers in extensions and would like to have access to js-ctypes, you should use the ChromeWorker OBJECT instead.

55.

In which way can the closure compiler can be used?(a) Open source(b) Run time application(c) Web application(d) Only Open source and Web applicationThe question was asked in examination.I want to ask this question from The Closure Compiler in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (d) Only Open source and Web APPLICATION

Easiest explanation: Closure COMPILER parses your JavaScript, analyzes it, REMOVES dead code and rewrites and minimizes what’s left. You can USE the Closure Compiler as:

An open source Java application that you can run from the command line.

A SIMPLE web application.

A RESTful API.

56.

What is the next step after calling the startTimeLogging()?(a) Interpret the code(b) Compile the code(c) Run the code(d) Debug the codeI have been asked this question in an international level competition.Query is from Cache Variables and Properties across Scope topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right CHOICE is (c) Run the code

For explanation: The startTimeLogging() method CAPTURES the timing data for AD HOC, etc for referencing an uncached document.location. Once the startTimeLogging() method is CALLED, run the code to test.

57.

Why do we need to create locally scoped variables to hold value?(a) To optimize the testing process(b) To increase the speed(c) To minimize memory usage(d) To cache the reference document.locationThis question was addressed to me during an online exam.My enquiry is from Cache Variables and Properties across Scope topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (d) To cache the REFERENCE DOCUMENT.location

To EXPLAIN: window.location.assign LOADS a new document. The locally scoped VARIABLES are created to cache the reference to document.location.

58.

The attribute location belongs to which element?(a) document(b) html(c) image(d) preI have been asked this question in exam.The query is from Cache Variables and Properties across Scope topic in section Caching, Debugging and Animation of JavaScript

Answer» RIGHT OPTION is (a) DOCUMENT

Best explanation: window.location.href returns the href (URL) of the CURRENT page. The attribute location belongs to the document element.
59.

What is the purpose of the area element?(a) Area of the text(b) Shape and coordinates of the hotspot(c) Shape and area of the hotspot(d) Coordinates and areaI got this question by my school principal while I was bunking the class.My question is taken from Image Map in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (b) Shape and coordinates of the hotspot

The EXPLANATION is: The tag defines an area INSIDE an image-map (an image-map is an image with clickable areas). The ELEMENT is always NESTED inside a tag. The area element specifies the shape and the coordinates that define the boundaries of each clickable hotspot.

60.

Which of the following can be implemented using animation?(a) Fireworks(b) Fade Effect(c) Roll-in or Roll-out(d) All of the mentionedThe question was posed to me during a job interview.The origin of the question is Animation in section Caching, Debugging and Animation of JavaScript

Answer»

The correct ANSWER is (d) All of the mentioned

Easiest EXPLANATION: JavaScript animations are done by programming gradual changes in an element’s style. You can use JavaScript to CREATE a complex ANIMATION which includes but not LIMITED to:

Fireworks

Fade Effect

Roll-in or Roll-out

Page-in or Page-out

Object movements.

61.

What is the purpose of the Attr object in the HTML DOM?(a) Used to focus on a particular part of the HTML page(b) HTML Attribute(c) Used to arrange elements(d) CSS attributeThis question was posed to me during an online interview.I'm obligated to ask this question of HTML DOM topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct choice is (B) HTML Attribute

The best I can explain: When a WEB page is LOADED, the browser CREATES a Document Object Model of the page. In the HTML DOM, the Attr object represents an HTML attribute.

62.

The object that looks to the thread that creates it is _______________(a) Window(b) Worker(c) Element(d) HashI have been asked this question in quiz.I want to ask this question from Web Workers topic in chapter Caching, Debugging and Animation of JavaScript

Answer» CORRECT option is (b) Worker

To explain: A web worker is a JavaScript running in the background, without AFFECTING the performance of the page. The Worker object: this is what a worker looks like from the OUTSIDE to the THREAD that creates it.
63.

In what way does the closure compiler help in checking the code?(a) Warnings(b) Suddenly aborts(c) Rejects malicious inputs(d) Terminates the executionThis question was posed to me at a job interview.I need to ask this question from The Closure Compiler topic in division Caching, Debugging and Animation of JavaScript

Answer» CORRECT option is (a) Warnings

Best explanation: Closure compiler PARSES your JavaScript, ANALYZES it, REMOVES dead code and rewrites and minimizes what’s left. The Closure Compiler provides warnings for illegal JavaScript and warnings for potentially dangerous operations, helping you to produce JavaScript that is LESS buggy and easier to maintain.
64.

What is the purpose of the advanced mode in the closure compiler?(a) Renames variables(b) Renames function(c) Both Renames variables and function(d) Changes structuresThis question was addressed to me during an internship interview.This is a very interesting question from The Closure Compiler topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right option is (C) Both Renames variables and function

Easiest EXPLANATION: In Advanced MODE it rewrites the JavaScript by renaming variables and functions from longer descriptive names to single LETTERS to save file SIZE, and it inlines functions, coalescing them into single functions wherever it determines that it can.

65.

What is the purpose of the basic validation?(a) Data correctness(b) Mere data existence(c) Both Data correctness and Mere data existence(d) Data modificationI got this question in an online quiz.My doubt stems from Validation topic in section Caching, Debugging and Animation of JavaScript

Answer»

Right OPTION is (b) Mere data existence

Easy explanation: The data entered through the SERVER side is USED for VALIDATION. First of all, the form must be checked to make sure data was entered into each form field that required it. This would need just loop through each field in the form and check for data.

66.

What is the purpose of the method nodeMap.setNamedItem()?(a) Sets ID(b) Sets attribute node(c) Sets element name(d) Sets element typeI got this question during a job interview.This is a very interesting question from HTML DOM in division Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (B) Sets ATTRIBUTE node

Explanation: The setNamedItem() method adds the SPECIFIED node to the NamedNodeMap. The method nodeMap.setNamedItem() sets the specified attribute node (by name).

67.

Which object can be used to create your own blobs?(a) Creator(b) BlobCreator(c) BlobBuilder(d) BuilderBlobThe question was asked in quiz.My question is from Blobs in JavaScript in division Caching, Debugging and Animation of JavaScript

Answer»

Right option is (c) BlobBuilder

Explanation: BLOBS represent data that isn’t NECESSARILY in a JavaScript-native format. You can create your own blobs, USING a BlobBuilder OBJECT to build them out of strings, ARRAYBUFFER objects, and other Blobs.

68.

What is the purpose of the function parameter filetype?(a) File type to be expected(b) File type previously got(c) File type that should not be got(d) File type availableThis question was posed to me in my homework.This interesting question is from External JavaScript and PHP in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct OPTION is (a) FILE type to be expected

Explanation: The File.type PROPERTY is an inbuilt FUNCTION of File WebAPI which gives the media type (MIME) of the file REPRESENTED by a file object. The function parameter “filetype” lets you tell the script what file type to expect before loading.

69.

The blobs are broken into smaller pieces using which of the following functions?(a) partition()(b) cut()(c) sliceall()(d) slice()The question was asked in an interview for job.Origin of the question is Blobs in JavaScript topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right CHOICE is (d) slice()

Explanation: The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user’s system. The web browser can store Blobs in memory or on DISK, and Blobs can represent REALLY enormous chunks of data (such as video files) that are too large to fit in main memory without FIRST being broken into smaller PIECES with slice().

70.

What kind of path can the PHP file be?(a) Absolute(b) Relative(c) Either Absolute or Relative(d) Both Absolute and RelativeThis question was addressed to me during an internship interview.My enquiry is from External JavaScript and PHP in division Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (c) EITHER ABSOLUTE or Relative

Best explanation: The PHP code is enclosed in special start and end PROCESSING instructions that allows you to jump into and out of “PHP MODE”. The PHP file is either an absolute or relative PATH to a PHP script instead of the usual .js file.

71.

Which of the following is added to prefs.js when the console is automatically opened during JavaScript error?(a) user_pref(“javascript.console.open_on_error”, true);(b) user_pref(“javascript.console.open_error “, true);(c) user_pref(“javascript.console.open_error “, false);(d) user_pref(” javascript.console.open_on_error”, false);The question was posed to me in homework.My query is from External JavaScript and PHP topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (a) user_pref(“javascript.console.open_on_error”, true);

EXPLANATION: The prefs.js file, located in the profile FOLDER, is used by FIREFOX and other Mozilla-based applications to store settings. For instance, when you create a NEW e-mail account in Thunderbird, the account NAME and server settings will be stored in the prefs.js file in your Thunderbird profile folder.

The code :

72.

Which of the following is not the properties of a plug-in entry?(a) name(b) filename(c) mimeTypes(d) valueI have been asked this question in an online interview.My question is from Validation in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (d) value

Explanation: Plugins are reusable portions of code which help you write EVEN LESS Javascript to achieve specific features on the client side. Each plug-in has an ENTRY in the ARRAY. Each entry has the following properties:

name – is the name of the plug-in.

filename – is the EXECUTABLE file that was loaded to install the plug-in.

description – is a description of the plug-in, supplied by the developer.

mimeTypes – is an array with one entry for each MIME type supported by the plug-in.

73.

Which of the following functions are referenced internally?(a) setTimeout(b) setInterval(c) both setTimeout and setInterval(d) clearIntervalThis question was addressed to me in exam.This key question is from JavaScript and Memory Leak in section Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (c) both setTimeout and setInterval

Easiest explanation: setTimeout(function, milliseconds) EXECUTES a function, after waiting a specified number of milliseconds. FUNCTIONS USED in setTimeout/setInterval are REFERENCED INTERNALLY and tracked until complete, then cleaned up.

74.

During the traversing through the stack, where does it go after it goes to the window?(a) Namespace(b) Function(c) Document(d) NowhereI have been asked this question in an interview.I need to ask this question from Cache Variables and Properties across Scope topic in portion Caching, Debugging and Animation of JavaScript

Answer»

Right OPTION is (d) Nowhere

To explain I WOULD say: window.location.assign loads a NEW DOCUMENT. During the traversal in the stack manner, after going to the window, it goes nowhere.

75.

Which of the following is one of the fundamental features of JavaScript?(a) Single-threaded(b) Multi-threaded(c) Both Single-threaded and Multi-threaded(d) Simple-threadedI got this question during a job interview.Query is from Web Workers topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct CHOICE is (a) Single-threaded

The best explanation: In computer programming, single-threading is the PROCESSING of ONE COMMAND at a time. One of the fundamental features of client-side JavaScript is that it is single-threaded: a browser will never RUN two event handlers at the same time, and it will never trigger a timer while an event handler is running.

76.

Which is the function that is called to validate a data?(a) validate()(b) valid()(c) validation()(d) no predefined function for data validationThis question was posed to me at a job interview.This key question is from Validation topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct choice is (d) no predefined FUNCTION for DATA VALIDATION

The best explanation: There is no such function to validate a data but, you can WRITE a function with any name to validate the data. Hence there is no predefined function for data validation.

77.

What would happen if the data in the client had been wrong?(a) Sends back the data(b) Waits for correction(c) Sends back the data and Waits for correction(d) Returns the data instantlyI got this question in an interview for internship.This interesting question is from Validation topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT choice is (C) Sends back the data and Waits for correction

To explain I would say: The only way to obtain data is from the server SIDE which is used to perform further operations on the data. If some of the data that had been entered by the CLIENT had been in the wrong form or was simply MISSING, the server would have to send all the data back to the client and request that the form is resubmitted with correct information.

78.

Which event handler is triggered when the user’s mouse moves onto a link?(a) onMouseOver(b) onMouseOut(c) onMouse(d) onMouseOntoI have been asked this question in examination.I need to ask this question from Animation in section Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (a) onMouseOver

For explanation I would say: The onmouseover attribute FIRES when the MOUSE pointer MOVES over an element. The onmouseover attribute is OFTEN used together with the onmouseout attribute.

79.

What is the necessity to have API?(a) Guide to performing activities(b) Describe particular task(c) Both performing activities and Describe particular task(d) Rearrangement of tasksI have been asked this question in an interview for job.Enquiry is from HTML APIs topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (B) Describe particular task

To elaborate: In COMPUTER programming, an application programming interface is a SET of subroutine definitions, communication protocols, and TOOLS for building software. An API may describe the ways in which a particular task is performed.

80.

Which of the following attribute takes the source of the PHP file?(a) img(b) src(c) source(d) psrcThe question was asked in quiz.This question is from External JavaScript and PHP topic in section Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT ANSWER is (b) src

For EXPLANATION: Php FILE is used an scripting language for backend development. The syntax to REFERENCING a PHP file using external JavaScript is consistent enough with what we already know:

81.

When does a memory leak happen?(a) Browser doesn’t release memory from objects unnecessary(b) Browser releases too many memories(c) Browser releases memory iteratively(d) Browser releases memory quicklyI got this question in quiz.This intriguing question comes from JavaScript and Memory Leak in division Caching, Debugging and Animation of JavaScript

Answer»

Right ANSWER is (a) Browser doesn’t release MEMORY from objects unnecessary

For explanation I would say: Memory leaks happen when your CODE needs to consume memory in your application, which should be RELEASED after a given task is complete but isn’t. Memory LEAK happens when the browser for some reason doesn’t release memory from objects which are not needed any more.

82.

Which of the following is not a navigator property?(a) platform[](b) plugin[](c) userAgent[](d) browser[]This question was addressed to me in a job interview.My query is from Image Map topic in portion Caching, Debugging and Animation of JavaScript

Answer» CORRECT choice is (d) browser[]

Explanation: The navigator object CONTAINS information about the browser. All of the above MENTIONED are the PROPERTIES of a navigator.
83.

Which handler is triggered when the content of the document in the window is stable and ready for manipulation?(a) onload(b) manipulate(c) create(d) oncreateI had been asked this question in examination.My question is from JavaScript and Memory Leak in section Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (a) ONLOAD

Easiest explanation: One of the most important event handlers is the onload handler of the Window object. It is TRIGGERED when the content of the document DISPLAYED in the window is stable and ready to be manipulated. JAVASCRIPT code is commonly WRAPPED within an onload event handler.

84.

What is the purpose of the event onAirEvent?(a) Content is played(b) Content is transferred(c) Both Content is played and transferred(d) Content is changedThis question was posed to me during an interview.I want to ask this question from HTML APIs in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (a) Content is played

For explanation I would SAY: The event onAirEvent is fired when the PLAYER starts playing content being broadcasted on the channel. The METHOD is CALLED at the time of the creation of adspace.

85.

Which of the following global variables is used to get parameters?(a) $HTTP_GET_VAR[](b) $HTTP_GET_VARS()(c) $HTTP_GET_VARS(d) $HTTP_GET_VARS[]I have been asked this question during a job interview.Question is from External JavaScript and PHP topic in portion Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (d) $HTTP_GET_VARS[]

Explanation: The global variable $HTTP_GET_VARS[] is used to GET PARAMETERS. $HTTP_GET_VARS CONTAINS the same initial information, but is not a SUPERGLOBAL.

86.

Which of the following is possible to be referenced in external JavaScript?(a) CPP(b) Cs(c) PHP(d) PythonI have been asked this question in an interview.My question comes from External JavaScript and PHP in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (C) PHP

To EXPLAIN I would say: PHP (RECURSIVE acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. One of the LESSER known sides of external JavaScript is the ability to reference a PHP file INSTEAD of the familiar .js file.

87.

The size of blobs are generally calculated in ____________(a) Meters(b) Kilometers(c) Bytes(d) PixelsI got this question by my school principal while I was bunking the class.This question is from Blobs in JavaScript topic in division Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (c) Bytes

The 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 are opaque all you can do with them DIRECTLY is determine their size in bytes, ask for their MIME type, and chop them up into smaller Blobs.

88.

The blobs are generally stored in ____________(a) Memory(b) Disk(c) Both Memory and Disk(d) Temporary storageI have been asked this question during an interview for a job.This intriguing question comes from Blobs in JavaScript in portion Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT choice is (c) Both Memory and Disk

The explanation: A Blob object represents a file-like object of immutable, raw data. The WEB BROWSER can store BLOBS in memory or on disk, and Blobs can represent really enormous chunks of data (such as video files) that are too large to fit in MAIN memory without first being broken into smaller pieces with slice().

89.

What will happen if you reference document.location from within an object?(a) Traverses the queue(b) Finds the bugs(c) Traverses the stack(d) Traverses the arrayThe question was posed to me in homework.My question comes from Cache Variables and Properties across Scope topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct answer is (c) Traverses the stack

For explanation: window.location.href returns the href (URL) of the current PAGE. If you REFERENCE DOCUMENT.location from within an object, the interpreter will need to go from the FUNCTION that references the VARIABLE, up out of the namespace to the global window scope, down to the document scope, and gets the location value.

90.

Which is the element that follows the use of “img”?(a) area(b) usemap(c) map(d) any element can follow the use of “img”The question was asked in examination.My enquiry is from Image Map topic in division Caching, Debugging and Animation of JavaScript

Answer»

Correct choice is (c) map

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 . The “map” element actually creates the map for the IMAGE and usually FOLLOWS directly after the “img ” element.

91.

What is the purpose of the Legacy DOM?(a) Makes the scripting easier(b) Allows access to few keys and elements(c) Modify the nodes(d) Making the script modularThe question was asked by my college director while I was bunking the class.Origin of the question is HTML DOM in division Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (b) Allows access to few keys and ELEMENTS

Best explanation: The Legacy DOM: This is the model which was introduced in early versions of JavaScript language. It is well SUPPORTED by all browsers but allows access only to CERTAIN KEY portions of documents, such as forms, form elements, and images.

92.

How do you focus a particular part of the HTML page in JavaScript?(a) hover()(b) focus()(c) on()(d) focuson()This question was addressed to me by my college professor while I was bunking the class.I'd like to ask this question from Validation in division Caching, Debugging and Animation of JavaScript

Answer»

Correct option is (b) FOCUS()

The best I can EXPLAIN: The focus() FUNCTION can be used to focus a particular part of the HTML page in JavaScript. It sets the ELEMENT as the active element in the current document. It can be applied to one html element at a single time in a current document.

93.

How to find the index of a particular string?(a) position()(b) index()(c) indexOf()(d) positionof()This question was posed to me in unit test.My doubt stems from Validation in division Caching, Debugging and Animation of JavaScript

Answer»

The correct OPTION is (c) indexOf()

The explanation: The indexOf() FUNCTION can be used to find out the INDEX of a particular character or a string. This method return an INTEGER telling the address of the particular character.

94.

What does the NamedNodeMap object represent in the HTML DOM?(a) Unordered collection of elements(b) Unordered collection of attributes(c) Unordered collection of nodes(d) Unordered collection of arraysThis question was posed to me by my college professor while I was bunking the class.This intriguing question comes from HTML DOM topic in section Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (d) UNORDERED COLLECTION of arrays

For explanation: In the HTML DOM, the NamedNodeMap object represents an unordered collection of an elements attribute nodes. The nodes in the NamedNodeMap can be ACCESSED through their NAME.

95.

How is everything treated in HTML DOM?(a) Node(b) Attributes(c) Elements(d) ArraysThis question was addressed to me in class test.My question comes from HTML DOM topic in division Caching, Debugging and Animation of JavaScript

Answer» RIGHT choice is (a) NODE

The BEST explanation: The HTML DOM model is constructed as a tree of Objects. In the HTML DOM (Document Object Model), everything is a node:

The document itself is a document node.

All HTML elements are element NODES.

All HTML attributes are attribute nodes.

TEXT inside HTML elements are text nodes.

Comments are comment nodes.
96.

The style property belongs to which of the following object?(a) Element(b) Window(c) Location(d) NavigationI had been asked this question in a national level competition.My question is taken from JavaScript and Memory Leak in chapter Caching, Debugging and Animation of JavaScript

Answer» CORRECT answer is (a) Element

For explanation I WOULD say: Each Element object has STYLE and CLASSNAME properties that allow scripts to specify CSS styles for a document element or to ALTER the CSS class names that apply to the element.
97.

In which format does JavaScript support external JavaScript?(a) .js(b) .php(c) .js/php(d) .jssI have been asked this question in an international level competition.Question is taken from External JavaScript and PHP topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct choice is (a) .js

To elaborate: JavaScript supports EXTERNAL JavaScript, in the form of .js file. This extension can be CAPTURED by a number of applications including: Windows Script Host, DREAMWEAVER MX, Notepad, Netscape Navigator, PavScrip, UltraEdit. The files are generally text files.

98.

Where are memory leaks found?(a) Client side objects(b) Server side objects(c) Both Client side and Server side objects(d) User side objectsThis question was addressed to me in an internship interview.My question is taken from JavaScript and Memory Leak topic in section Caching, Debugging and Animation of JavaScript

Answer»

The correct option is (a) Client side objects

Easiest explanation: MEMORY leaks happen when your code needs to CONSUME memory in your APPLICATION, which should be released after a given TASK is completed but isn’t. Memory leaks occur when we are developing client-side reusable scripting objects.

99.

What will happen when the data of the jQuery.cache is read from an element?(a) Unique number is retrieved as elem[jQuery.expando](b) Data is read from jQuery.cache[id](c) Unique number is retrieved as elem[jQuery.expando] & Data is read from jQuery.cache[id](d) Data is cleared from jQuery.cache[id]I have been asked this question during an interview.Enquiry is from JavaScript and Memory Leak topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

The correct choice is (C) UNIQUE number is retrieved as elem[jQuery.expando] & Data is READ from jQuery.cache[id]

The EXPLANATION is: jQuery.cache[id] is used to associate handlers and other data with elements. When the data is read from an ELEMENT:

The element unique number is retrieved from id = elem[ jQuery.expando].

The data is read from jQuery.cache[id].

100.

Which API makes the user’s current location available to browser-based application?(a) Java API(b) SDL API(c) Object API(d) Geolocation APII got this question in an online quiz.I'd like to ask this question from HTML APIs in division Caching, Debugging and Animation of JavaScript

Answer»

The CORRECT choice is (d) Geolocation API

To explain I would SAY: The Geolocation API allows the user to PROVIDE their location to web applications if they so DESIRE. For PRIVACY reasons, the user is asked for permission to report location information.