ExamVeda
Login
Home
11
The URL property belongs to which of the following object?
Discuss
Answer & Solution
Answer: Option A
Solution:
The Document object has a URL property, which is a static string that holds the URL of the document when it was first loaded.
12
What does the location property represent?
Discuss
Answer & Solution
Answer: Option A
Solution:
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.
13
Which among the following is not a property of the Location object?
Discuss
Answer & Solution
Answer: Option C
Solution:
The various properties of the location object are the protocol, host, hostname, port, search, and hash.
14
What is the return type of the hash property?
Discuss
Answer & Solution
Answer: Option D
Solution:
The hash property returns the “fragment identifier” portion of the URL, if there is one: a hash mark (#) followed by an element ID.
15
What is the function used to extract arguments from the search property of a URL?
Discuss
Answer & Solution
Answer: Option A
Solution:
The urgArgs() function can be used to extract arguments from the search property of a URL.
16
The decodeURIComponent() is defined by
Discuss
Answer & Solution
Answer: Option B
Solution:
The decodeURIComponent() is a global function defined by client-side JavaScript.
17
Which is the method that removes the current document from the browsing history before laoding the new document?
Discuss
Answer & Solution
Answer: Option C
Solution:
The replace() method is similar, but it removes the current document from the browsing history before loading the new document. When a script unconditionally loads a new document, the replace() method is often a better choice than assign().
18
Why is the replace() method better than the assign() method?
Discuss
Answer & Solution
Answer: Option D
Solution:
The replace() method is similar, but it removes the current document from the browsing history before loading the new document. When a script unconditionally loads a new document, the replace() method is often a better choice than assign().
19
What is the purpose of the assign() method?
Discuss
Answer & Solution
Answer: Option B
Solution:
The assign() method of the Location object makes the window load and display the document at the URL you specify.
20
The history property belongs to which object?
Discuss
Answer & Solution
Answer: Option C
Solution:
The history property of the Window object refers to the History object for the window.