250+ TOP MCQs on Error Handling and Answers

JavaScript Questions and Answers for Freshers on “Error Handling – II”.

1. Each tab in the single web browser window is called as ____________
a) Browser Information
b) Browsing context
c) Both Browser Information & Browsing context
d) Browser Log
Answer: b
Clarification: A single web browser window on your desktop may contain several tabs. Each tab is an independent browsing context. browser context is also defined as the environment in which the browser displays a document.

2. Nested documents inside the HTML documents can be created using ___________
a) frame
b) nest
c) iframe
d) into
Answer: c
Clarification: HTML documents may contain nested documents using an iframe element. An iframe creates a nested browsing context represented by a Window object of its own.

3. How are windows, tabs, iframes, and frames treated according to client-side javascript?
a) They are all browsing contexts
b) They are all browsing information
c) They are all Window contexts
d) They are all Window objects
Answer: a
Clarification: Client-side JavaScript makes very little distinction between windows, tabs, iframes, and frames they are all browsing contexts, and to JavaScript, they are all Window objects.

4. How are windows, tabs, iframes, and frames treated according to javascript?
a) They are all browsing contexts
b) They are all browsing information
c) They are all Window contexts
d) They are all Window objects
Answer: d
Clarification: Client-side JavaScript makes very little distinction between windows, tabs, iframes, and frames they are all browsing contexts, and to JavaScript, they are all Window objects.

  250+ TOP MCQs on Getting Started with R and Answers

5. A new web browser window can be opened using which method of the Window object?
a) createtab()
b) Window.open()
c) open()
d) create()
Answer: b
Clarification: You can open a new web browser window with the open() method of the Window object. Window.open() loads a specified URL into a new or existing window and returns the Window object that represents that window.

6. What will happen if the first argument of open() is omitted?
a) Error Page
b) Remains in the same page
c) about:blank
d) Reloads the page
Answer: b
Clarification: The first argument in the open function is for the url of the page which is to be opened. When the first argument of the open() is omitted, the about:blank is opened.

7. Which object serves as the global object at the top of the scope chain?
a) Hash
b) Property
c) Element
d) Window
Answer: d
Clarification: The Window object serves as the global object at the top of the scope chain in client-side JavaScript. All global JavaScript objects, functions, and variables automatically become members of the window object.

8. Which is the property of a Window object that holds the name of the frame?
a) name
b) title
c) description
d) style
Answer: a
Clarification: The name property of a Window object holds the name of the frame if it has one. This property is writable, and scripts can set it as desired. An iframe creates a nested browsing context represented by a Window object of its own.

  250+ TOP MCQs on Client-Side Frameworks and Answers

9. When will the fourth argument to open() useful?
a) When the second argument names a retired window
b) When the first argument names an existing window
c) When the second argument names an existing window
d) When the first argument names a retired window
Answer: c
Clarification: The fourth argument to open() is useful only when the second argument names an existing window. This fourth argument is a boolean value that indicates whether the URL specified as the first argument should replace the current entry in the window’s browsing history (true) or create a new entry in the window’s browsing history (false). Omitting this argument is the same as passing false.

10. The inner frame within a top-level window can be referred to as _____________
a) parent(parent)
b) parent.parent
c) parent*parent
d) parent/parent
Answer: b
Clarification: Frames returns the window itself, which is an array-like object, listing the direct sub-frames of the current window. If a frame is contained within another frame that is contained within a top-level window, that frame can refer to the top-level window as parent.parent.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top