Q. A new web browser window can be opened using which method of the Window object ?

  • (A) createtab()
  • (B) Window.open()
  • (C) open()
  • (D) all of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Window.open()
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.

Q. What will happen if the first argument of open() is omitted?

  • (A) Error Page
  • (B) Remains in the same page
  • (C) about:blank
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Remains in the same page
Explanation: When the first argument of the open() is omitted, the about:blank is opened.

Q. Which object serves as the global object at the top of the scope chain?

  • (A) Hash
  • (B) Property
  • (C) Element
  • (D) Window
πŸ’¬ Discuss
βœ… Correct Answer: (D) Window
Explanation: The Window object serves as the global object at the top of the scope chain in client-side JavaScript.

Q. Which is the property of a Window object that holids the name of the frame?

  • (A) name
  • (B) title
  • (C) description
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) name
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.

Q. 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
πŸ’¬ Discuss
βœ… Correct Answer: (C) When the second argument names an existing window
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.

Q. The inner frame within a top-level window can be referred as

  • (A) parent(parent)
  • (B) parent.parent
  • (C) parent*parent
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) parent.parent
Explanation: 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.

Q. What is the code snippet to go back to a history twice?

  • (A) history(2);
  • (B) history(-2);
  • (C) history.go(-2);
  • (D) history.go(2);
πŸ’¬ Discuss
βœ… Correct Answer: (C) history.go(-2);
Explanation: The above code snippet goes back 2, like clicking the Back button twice.

Q. If the window has child windows, how will the browsing histories be affected?

  • (A) Numerically interleaved
  • (B) Chronologically interleaved
  • (C) Both Numerically and Chronologically interleaved
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (B) Chronologically interleaved
Explanation: If a window contains child windows, the browsing histories of the child windows are chronologically interleaved with the history of the main window.

Q. The length property belongs to which of the following objects?

  • (A) Window
  • (B) Element
  • (C) History
  • (D) Document
πŸ’¬ Discuss
βœ… Correct Answer: (C) History
Explanation: The length property of the History object specifies the number of elements in the browsing history list, but for security reasons scripts are not allowed to access the stored URLs.

Q. What is the datatype of the go() method’s parameter?

  • (A) String
  • (B) Integer
  • (C) Double
  • (D) Float
πŸ’¬ Discuss
βœ… Correct Answer: (B) Integer
Explanation: The go() method takes an integer argument and can skip any number of pages forward and backward in the history list.