This is a use of the code in the Flash site, he is using JS to obtain browser user information and then create a different version of the Flash component instances, so good compatible with most of the mainstream browser OK.*/var Isie =
This article describes how to use the Baidu map api and html5 features of javascript to obtain the location of a browser.
The Code is as follows:
Click this button to get your location:
Try it
Web page Visible area width: document.body.clientWidthWeb page Visible Area height: document.body.clientHeightWeb page Visible Area width: document.body.offsetWidth (including edge width)Web page Visible Area High: document.body.offsetHeight
Get the browser version in PHP directly using http_user_agent can be, but to determine the specific browser, what version we need to judge each,
Example 1
The code is as follows
Copy Code
function Get_user_browser () {if
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, padding,
In IE without declaring doctype, the browser display window size can only be obtained from the following:Document.body.offsetWidthdocument.body.offsetHeightIn a browser that declares DOCTYPE, you can use the following to get the browser display
Work needs to go through JS to get the name of the browser currently in use and version number, on the internet a lot of data have a key word is Navigator.appname, but this method gets the name of the browser is only two, ie or netscap, it can be
Window has a navigator object that lets us know all about the browser. We can use a series of API functions to learn about the browser's information.
The JavaScript code is as follows:
Function message ()
{
txt = " Browser code Name: +
Request.Browser.MajorVersion.ToString ()///Get the client browser (main) version number Request.Browser.Version.ToString ();//Get the full version number of the client browserRequest.Browser.Platform.ToString ()//Get the name of the client using the
For multilingual versions of the project, the foreground uses Easyui to load the Easyui language pack relative to the browser language version, Easyui the default language pack en-US
The code is as follows
//ie
if (navigator.browserlanguage!
The code is very concise, functional very practical, here is not much nonsense, directly to the code:
/** * Created by the Administrator on 15-1-12. */function Broswerutil () {} Broswerutil = {//Detect browser version
For multilingual versions of the project, the foreground uses Easyui to load the Easyui language pack relative to the browser language version, Easyui the default language pack en-US
The code is as follows
1 2 3 4 5 6 7 8 9 10 11 12 13-
-------------------------------------------------JS---------------------------------------------------------------Web page Visible area width: document.body.clientwidth** Web page Visible Area High: document.body.clientheight** Web page Visible area
The Navigator object contains basic information about the Web browser (such as name, version, operating system, etc.)
You can refer to the object by Window.navigator and use its properties to read the client base information
5 Main properties of
。 If so, the values of Document.documentElement.clientWidth and document.documentElement.clientHeight are used respectively. Otherwise, the values of Document.body.clientWidth and document.body.clientHeight are used.
var pagewidth =
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.