1.

What is the purpose of the window.location object in JavaScript?(a) Get the URL and redirect(b) Get the location of the cursor(c) Get the path to the next page(d) Get the location & path of the next pageThis question was posed to me during an interview.I need to ask this question from Creating a Shared Configuration File using JavaScript in chapter Parsing, Benchmarking and Logging of JavaScript

Answer»

The correct choice is (a) Get the URL and redirect

Explanation: The window.location OBJECT can be used to get the current page address (URL) and to redirect the browser to a new page. The PARAMETER location specifies the agent location, SPEED and browser to use for the TEST, formatted as location.browser:location.



Discussion

No Comment Found

Related InterviewSolutions