logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

JavaScript Multiple Choice Questions | MCQs | Quiz

Javascript Interview Questions and Answers
Pratice Javascript questions and answers for interviews, campus placements, online tests, aptitude tests, quizzes and competitive exams.

Get Started

•   Lexical Structure
•   Types, Values & Variables
•   Expressions & Operators
•   Statements
•   JavaScript Loops
•   Object Attributes
•   Array & Related Methods
•   Invoking Functions
•   Functional Programming
•   Closures
•   JavaScript Classes
•   Augmentation of Classes
•   JavaScript Modules
•   Pattern Matching
•   JavaScript Subsets
•   JavaScript Extentions
•   Shorthand Functions
•   Server-Side JavaScript
•   Scripting Java - Rhino
•   Asynchronous I/O - Rhino
•   Client-Side JavaScript
•   Embedding JavaScript
•   JavaScript-Web Browsers-1
•   JavaScript-Web Browsers-2
•   Client-Side Frameworks
•   Document Object Model
•   Window Object
•   Error Handling - 1
•   Error Handling - 2
•   Scripting Documents
•   Scripting CSS
•   Handling Events
•   Mouse Events
•   Text Events
•   Drag & Drop Events
•   Keyboard Events
•   Node Operations - 1
•   Node Operations - 2
•   Cookies
•   Scripted HTTP
•   The jQuery Library
•   Client-Side Storage
•   Client-Side Databases
•   Scripted Media
•   Graphics
•   Browser Rendering - 1
•   Browser Rendering - 2
•   JavaScript Performance - 1
•   JavaScript Performance - 2
•   JavaScript - FireBug
•   JavaScript - YSlow
•   JavaScript - WebPagetest
•   JavaScript Minification - 1
•   JavaScript Minification - 2
•   Web Sockets
•   JavaScript History
•   Getting Started with R - 1
•   Getting Started with R - 2
•   Getting Started with R - 3
•   Enhanced JavaScript with R
•   WebPagetest API Access
•   Configuration File Creation
•   Parsing Values - 1
•   Parsing Values - 2
•   JavaScript Benchmarking-1
•   JavaScript Benchmarking-2
•   Public API Crafting
•   Remote Logging
•   Object Invocation
•   PerfLogger Performance
•   Navigation & Memory - 1
•   Navigation & Memory - 2
•   BottleNecks Optimization
•   Script Loading - 1
•   Script Loading - 2
•   Lazy Loading - 1
•   Lazy Loading - 2
•   Cache Variable & Properties
•   Closure Compiler
•   Web Workers
•   JavaScript Blobs
•   JavaScript & Memory Leak
•   External JavaScript & PHP
•   HTML APIs
•   HTML DOM
•   Animation
•   Validation
•   Image Map
•   Debugging Forms
•   JavaScript vs Frameworks-1
•   JavaScript vs Frameworks-2

Best Reference Books

Javascript Books
« Prev Page
Next Page »

JavaScript Questions & Answers – History Management in JavaScript

Posted on August 29, 2013 by Manish

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “History Management in JavaScript”.

1. What does an History object contain?
a) URL
b) Parameters
c) Attribute values
d) Property
View Answer

Answer: a
Explanation: The history object contains the URLs visited by the user (within a browser window).

2. The history object is a part of which object?
a) Property
b) Window
c) Location
d) Screen
View Answer

Answer: b
Explanation: The history object belongs to the Window object.

3. How many methods are there in the History object?
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: a
Explanation: There are three methods belongign to the History object namely :

  1. back()
  2. forward()
  3. go()

4. What is the purpose of the method forward()?
a) Loads any random URL in the history list
b) Loads the previous URL in the history list
c) Loads a specific URL from the history list
d) Loads the next URL in the history list
View Answer

Answer: d
Explanation: The forward() method loads the next URL in the history list.

5. How will you update the URL displayed in the location bar?
a) location
b) location.URL
c) location.hash
d) url
View Answer

Answer: c
Explanation: The property location.hash needs to be updated to display the updated URL in the location bar.

6. How do you add a particular state to the browsing history?
a) pushState()
b) replaceState()
c) state()
d) none of the mentioned
View Answer

Answer: a
Explanation: The pushState() method adds a particular state to the browsing history.

7. What does the pushState() method do?
a) Removes the state
b) Adds new state
c) Replaces the state
d) None of the mentioned
View Answer

Answer: b
Explanation: When a web app enters a new state, it calls history.pushState() to add that state to the browsing history.

8. Which of the following method is used to replace the current history state instead of adding a new state to the browsing history?
a) replaceState()
b) replace(state)
c) replace()
d) none of the mentioned
View Answer

Answer: a
Explanation: The replaceState() method is used to replace the current history state instead of adding a new state to the browsing history.

9. How many parameters does the replaceState() method take?
a) 2
b) 3
c) 4
d) 5
View Answer

Answer: b
Explanation: 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.

10. What is the purpose of the event window.onpopstate?
a) When a state object is replaced
b) When a state object is added
c) When a state object is removed
d) None of the mentioned
View Answer

Answer: c
Explanation: 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.

Sanfoundry Global Education & Learning Series – Javascript Programming.

To practice all areas of Javascript, here is complete set of 1000+ Multiple Choice Questions and Answers on Javascript.

« Prev Page - JavaScript Questions & Answers – Web Sockets
» Next Page - JavaScript Questions & Answers – Getting Started with R – I
« JavaScript Questions & Answers – Web Sockets
JavaScript Questions & Answers – Getting Started with R – I »

Deep Dive @ Sanfoundry:

  1. Structural Analysis Questions and Answers
  2. Database Management System Questions and Answers
  3. Artificial Intelligence Questions and Answers
  4. Javascript Questions and Answers
  5. JavaScript Questions & Answers – Cache Variables and Properties across Scope
  6. JavaScript Questions & Answers – Embedding JavaScript in HTML
  7. JavaScript Questions & Answers – Scripted HTTP
  8. JavaScript Questions & Answers – The Document Object Model
  9. JavaScript Questions & Answers – Performance Navigation and Memory – I
  10. JavaScript Questions & Answers – JavaScript in Web Browsers – I
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry