Q. What is the special feature of the modern web applications?

  • (A) Can alter contents without loading document
  • (B) Must load the document to manipulate
  • (C) All of the mentioned
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) Can alter contents without loading document
Explanation: Modern web applications can dynamically alter their own content without loading a new document.

Q. The navigator property belongs to which of the following object?

  • (A) Document
  • (B) Window
  • (C) Navigator
  • (D) Location
πŸ’¬ Discuss
βœ… Correct Answer: (C) Navigator
Explanation: The navigator property of a Window object refers to a Navigator object that contains browser vendor and version number information.

Q. What is the vendor-neutral synonym for navigator?

  • (A) staticData
  • (B) purposeInformation
  • (C) dataInformation
  • (D) clientInformation
πŸ’¬ Discuss
βœ… Correct Answer: (D) clientInformation
Explanation: IE supports clientInformation as a vendor-netural synonym for navigator.

Q. Which is the preferred testing nowadays for scripting?

  • (A) Software testing
  • (B) Feature testing
  • (C) Blackbox testing
  • (D) Whitebox testing
πŸ’¬ Discuss
βœ… Correct Answer: (B) Feature testing
Explanation: In the past, the Navigator object was commonly used by scripts to determine if they were running in Internet Explorer or Netscape. This “browser-sniffing” approach is problematic because it requires constant tweaking as new browsers and new versions of existing browsers are introduced. Today, feature testing is preferred: rather than making assumptions about particular browser versions and their features, you simply test for the feature (i.e., the method or property) you need.

Q. Which of the below properties can be used for browser sniffing?

  • (A) platform
  • (B) appVersion
  • (C) both platform and appVersion
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) both platform and appVersion
Explanation: The platform and appVersion can be used for browser sniffing.

Q. Where is the information of the userAgent property located?

  • (A) appId
  • (B) appName
  • (C) platform
  • (D) appVersion
πŸ’¬ Discuss
βœ… Correct Answer: (D) appVersion
Explanation: The string that the browser sends in its USER-AGENT HTTP header. This property typically contains all the information in appVersion and may contain additional details as well. Like appVersion, there is no standard format. Since this property contains the most information, browser-sniffing code typically uses it.

Q. The URL property belongs to which of the following object?

  • (A) Document
  • (B) Element
  • (C) Location
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) Document
Explanation: The Document object has a URL property, which is a static string that holds the URL of the document when it was first loaded.

Q. What does the location property represent?

  • (A) Current DOM object
  • (B) Current URL
  • (C) Both DOM object and URL
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (A) Current DOM object
Explanation: The location property of a window is a reference to a Location object; it represents the current URL of the document being displayed in that window.

Q. Which among the following is not a property of the Location object?

  • (A) protocol
  • (B) host
  • (C) hostee
  • (D) hostname
πŸ’¬ Discuss
βœ… Correct Answer: (C) hostee
Explanation: The various properties of the location object are the protocol, host, hostname, port, search, and hash.

Q. What is the return type of the hash property?

  • (A) Query string
  • (B) Packets
  • (C) String
  • (D) Fragment identifier
πŸ’¬ Discuss
βœ… Correct Answer: (D) Fragment identifier
Explanation: The hash property returns the “fragment identifier” portion of the URL, if there is one: a hash mark (#) followed by an element ID.