1.

Which of the following method loads a new document?(a) location.new()(b) loadnew()(c) location.load()(d) location.assign()This question was addressed to me in an online interview.My question comes from Creating a Shared Configuration File using JavaScript topic in section Parsing, Benchmarking and Logging of JavaScript

Answer»

The CORRECT option is (d) location.assign()

To elaborate: The window.location OBJECT can be written WITHOUT the window prefix.

Some examples are window.location.href returns the href (URL) of the current page

window.location.hostname returns the domain name of the web host.



Discussion

No Comment Found

Related InterviewSolutions