Correct Answer: The windowhistory object can be written without the window prefix To protect the privacy of the users, there are limitations to how JavaScript can access this object Some methods: historyback() - same as clicking back in the browser historyforward() - same as clicking forward in the browser
2. What are the different objects used in JavaScripts?
Correct Answer: JavaScripts uses a hierarchical structure that applies to the objects in a document There are some objects that show the relationship of one object to another using the language Window object: This is the topmost object in the hierarchy It represent the content area of browser window that consists of HTML documents Each frame is also a window that has some actions inside it Document object: This object gets loaded in a window and consists of objects of different kind in the model It consists of the content that will be written in the script Form object: Form objects are used for more interaction with the users It represents the form elements inside tag
3. What is Javascript namespacing? How and where is it used?
Correct Answer: Using global variables in Javascript is evil and a bad practice That being said, namespacing is used to bundle up all your functionality using a unique name In JavaScript, a namespace is really just an object that you?ve attached all further methods, properties and objects It promotes modularity and code reuse in the application
4. How JavaScript timers work? What is a drawback of JavaScript timers?
Correct Answer: Timers allow you to execute code at a set time or repeatedly using an interval This is accomplished with the setTimeout, setInterval, and clearInterval functions The setTimeout(function, delay) function initiates a timer that calls a specific function after the delay; it returns an id value that can be used to access it later The setInterval(function, delay) function is similar to the setTimeout function except that it executes repeatedly on the delay and only stops when cancelled The clearInterval(id) function is used to stop a timer Timers can be tricky to use since they operate within a single thread, thus events queue up waiting to execute
Correct Answer: jQuery is a quick as well as concise JavaScript Library that simplifies HTML document traversing, animating, event handling, & Ajax interactions for the purpose of quick web development needs So although they are not entirely different, both are not the same either!
6. Which of the following navigator object properties is the same in both Netscape and IE?
Correct Answer: Some of the new features provided in HTML5 are: - It provides support for local storage - New form controls, like calendar, date, time, email, url, search -