ExamVeda
Login
Home
11
The history object is a part of which object?
Discuss
Answer & Solution
Answer: Option B
Solution:
The history object belongs to the Window object.
12
How many methods are there in the History object?
Discuss
Answer & Solution
Answer: Option A
Solution:
There are three methods belongign to the History object namely :
1. back()
2. forward()
3. go()
13
What is the purpose of the method forward()?
Discuss
Answer & Solution
Answer: Option D
Solution:
The forward() method loads the next URL in the history list.
14
How will you update the URL displayed in the location bar?
Discuss
Answer & Solution
Answer: Option C
Solution:
The property location.hash needs to be updated to display the updated URL in the location bar.
15
How do you add a particular state to the browsing history?
Discuss
Answer & Solution
Answer: Option A
Solution:
The pushState() method adds a particular state to the browsing history.
16
What does the pushState() method do?
Discuss
Answer & Solution
Answer: Option B
Solution:
When a web app enters a new state, it calls history.pushState() to add that state to the browsing history.
17
Which of the following method is used to replace the current history state instead of adding a new state to the browsing history?
Discuss
Answer & Solution
Answer: Option A
Solution:
The replaceState() method is used to replace the current history state instead of adding a new state to the browsing history.
18
How many parameters does the replaceState() method take?
Discuss
Answer & Solution
Answer: Option B
Solution:
window.history.replaceState(stateObj, title, url) : This is just like window.history.pushState, except that the current browser state is removed from the history, so you cannot hit “back” to return to it.
19
What is the purpose of the event window.onpopstate?
Discuss
Answer & Solution
Answer: Option C
Solution:
The window.onpopstate event is fired whenever a state object is removed from the browser history, which occurs on browser “back” or “forward”. State objects are persisted on the user’s hard disk between sessions, which is a nice feature. The object passed into a call to pushState or replaceState is provided as the state property on the event object in the “popstate” event.
20
R is an extension of which of the following language?
Discuss
Answer & Solution
Answer: Option C
Solution:
R is an extension of and successor to the S language, which was itself a statistical language created in 1976 by John Chambers while at Bell Labs.