Home  >  Article  >  Web Front-end  >  Detailed introduction to window sub-objects

Detailed introduction to window sub-objects

零下一度
零下一度Original
2017-06-26 10:24:244243browse

Window sub-object

(1) Location object

 

The Location object contains information about the current URL (Uniform Resource Locator) Information. (Uniform Resource Location)

The Location object is part of the Window object and can be accessed through the window.location property.

location.hostname Returns the hostname of the current URL.

location.pathname Returns the path portion of the current URL.

location.protocol Returns the protocol of the current URL.

location.href Returns the full URL.

(2) Navigator object

The Navigator object contains information about the browser.

appName Returns the name of the browser.

appCodeName Returns the browser's code name as a string.

cookieEnabled Boolean value indicating whether cookies are enabled in the browser.

platform Returns the operating system platform on which the browser is running.

appVersion Returns the browser’s platform and version information.

userAgent--String representation of the user agent header

(3)Screen object

The Screen object contains information about the client's display screen.

height returns the height of the display screen. width returns the width of the monitor screen.

availHeight Displays the available height of the screen (except for the Windows taskbar).

availWidth Displays the available width of the screen (except for the Windows taskbar).

(4) History object

The History object contains the URLs visited by the user (in the browser window).

back() Loads the previous URL in the history list if it exists.

forward() Loads the next URL in the history list.

The above is the detailed content of Detailed introduction to window sub-objects. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn