As shown below:
Screen.width
screen.height
screen.availheight//Get screen height after removing status bar
screen.availwidth//Get screen height after removing status bar
First, the size of the screen to get through the browser
Second,
One is implemented using jquery, which is done by downloading the jquery library.
The code is as follows
Copy Code
In IE 805Under the FF whether 787 Oh,
The two browsers are different because they display
In IE:Document.body.clientWidth ==> Body Object widthDocument.body.clientHeight ==> Body Object HeightDocument.documentElement.clientWidth ==> Visible Area widthDocument.documentElement.clientHeight ==> Visible Area heightIn
ie: document.body.clientWidth ==> body Object width document.body.clientHeight ==> Body Object Height Document.documentElement.clientWidth ==> Visible Area width document.documentElement.clientHeight ==> visible area height in Firefox: Document.body.
Javascript:alert (document.body.clientWidth); Web page visible area width (body)alert (document.body.clientHeight); Web page Visible Area high (body)alert (document.body.offsetWidth); Web page visible area width (body), including border, margin, etc.
In IE:Document.body.clientWidth ==> Body Object widthDocument.body.clientHeight ==> Body Object HeightDocument.documentElement.clientWidth ==> Visible Area widthDocument.documentElement.clientHeight ==> Visible Area heightIn
To get the size of the browser window (the viewport of the browser, excluding toolbars and scroll bars):First, for ie9+, Chrome, Firefox, Opera and Safari:window.innerheight-Interior height of the browser windowwindow.innerwidth-Interior width of
Web page Visible area width: document.body.clientWidthWeb page Visible Area height: document.body.clientHeightWeb page Visible Area width: document.body.offsetWidth (including edge and scroll bar width)Web page Visible Area High:
Recently in doing WebForm, browser compatibility is a problem, here I collected some information to obtain the browser, can be used for some users, prompted the browser version is too low, let the upgrade version. This will save us a lot of time
Javascript:In IE:Document.body.clientWidth ==> Body Object widthDocument.body.clientHeight ==> Body Object HeightDocument.documentElement.clientWidth ==> Visible Area widthDocument.documentElement.clientHeight ==> Visible Area heightIn
In JavaScript, it is often necessary to get the document element, which is an abbreviation for the HTML Document Object model, which defines a series of standard objects for HTML and a standard way to access and manipulate HTML documents. Through
Js get close browser event, js get Browser
Google browser, Firefox browser and 360 browser are feasible, and IE7 is also feasible.
Confirm Before Leave baidu
Test:
1. 360 browser testing
2. Google browser testing
3. IE7
Js to get browser information and page information
1. js gets browser information, including determining whether the browser is mobile or not, browser information, and android version
2. js obtains the url, domain, and title of the page.
Function
In IE:Document.body.clientWidth ==> Body Object widthDocument.body.clientHeight ==> Body Object HeightDocument.documentElement.clientWidth ==> Visible Area widthDocument.documentElement.clientHeight ==> Visible Area heightIn
In IE:Document.body.clientWidth ==> Body Object widthDocument.body.clientHeight ==> Body Object HeightDocument.documentElement.clientWidth ==> Visible Area widthDocument.documentElement.clientHeight ==> Visible Area heightIn
Servlet HTTP Status code The format of the HTTP request and HTTP response message is similar, with the following structure:
Initial status line + carriage return newline character (carriage return + line feed)
0 or more header lines + carriage
Bro () {Let Broname = ' runing 'Let Strstart = 0Let Strstop = 0Let temp = "Let useragent = window.navigator.userAgent//A string containing all or part of the following properties: Appcodename,appname,appversion,language,platformFireFoxif
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.