This set of JavaScript Questions and Answers for Freshers focuses 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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.
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()
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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
View Answer
Explanation: 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.
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
View Answer
Explanation: 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
View Answer
Explanation: 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.
Sanfoundry Global Education & Learning Series – Javascript Programming.
- Get Free Certificate of Merit in JavaScript
- Participate in JavaScript Certification Contest
- Become a Top Ranker in JavaScript
- Take JavaScript Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Practice Information Science MCQs
- Buy JavaScript Books
- Apply for Information Technology Internship
- Buy Programming Books
- Practice Programming MCQs