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 browserInfo () {var
What is the user agentThe user agent in Chinese is called "UA," which is a special string header that enables the server to identify the operating system and version, CPU type, browser and version, browser rendering engine, browser language, browser plugin, and so on that the client uses.Websites can be judged by diffe
What I want to say is why I wrote this blog to commemorate my introduction to the Firefox browser. Recently, began to contact it, saw a lot of it cattle people strongly recommend the use of "Firefox browser" as a development.Won the guidance of Daniel!DownloadInstallationThis is to sync some of the information in our previous browser to the Firefox
Jakarta's httpclient3.1 is the latest version. In this project, you must use a program to simulate the get and post actions of the browser. Many problems are encountered during use.1. Post submission with attachmentsThe class multipartpostmethod was used at the beginning and is now obsolete. API description:Deprecated.UseMultipartRequestEntityIn conjunctionPostMethodInstead.With postmethod, there is no need
Javascript: Get the available width and height of the browser window and Screen
1. Get the valid width and height of the browser window (excluding the toolbar and scroll bar)
NOTE: For the top ten visitors, you can use the specified parameter innerwidthto obtain the width. Use document.doc umentElement. clientWidth | d
1 using GET Request data1) Java Code $.getjson ("Sortshow!sortshow?time=" +new Date (). GetTime (), function () {}); At first I wrote the Java code directly, $.getjson (" Sortshow!sortshow,function () {}), so when the refresh of IE will show the last cache, so you have to submit new data, so after adding a time parameter, even if you do not set this parameter in the background, but will not error.At this point, IE will re-send a request to the backgro
//get the last child element screen browser differences functionGetlastelementchild (Element) {//ability detection to determine if support Lastelementchild if(element.lastelementchild) {//support for returning elements returnElement.lastelementchild; }Else{ //I do not know the next sibling node varnode =Element.lastchild; while(Node node.nodetype!==1){
A few days ago when the project was encountered when the browser scale is not 100%, out of the page is not normal, and found a way to get its proportions to inform the userfunction Detectzoom () {varRatio =0, screen=Window.screen, UA=navigator.userAgent.toLowerCase (); if(Window.devicepixelratio!==undefined) {ratio=Window.devicepixelratio; } Else if(~ua.indexof ('MSIE')) { if(screen.devicexdpi screen.
1.js Get Browser Info: Contains information about whether the mobile side, and browser info, Android version2.js get page URL, domain, titlefunction Browserinfo () {var browser = {Versions:function () {var u = Window.navigator.useragent;//android version var num;if (U. Index
//get transform compatible notation for current browser supportfunction Gettransfrom () {varTransform ="', //document.createelement () Creates an element node,Divstyle = Document.createelement ('Div'). Style,//returns a set of object objects containing the transform//There are several compatibility ways that may be involved, through loops, to find out what the browser
JS can be obtained,document.getElementById ("Div ID or other selection"). OffsetTop; it's off the top.JQ can do this:$ ("#aaa"). Offset (). Top; JQ gets the distance of the AAA element from the bodydocument.getElementById ("DDHDH"). InnerHTML can get all the data in the div, including the tags ... But it's only used in IE and opera.document.getElementById ("DDHDH"). InnerTEXT can get the text data into the
just took over a backup system browser bookmark module, now put the code out, there are a few questions please pass the Great God advice1, according to the official API should be there are several fields are availableBut in addition to the title and URL to get the other will be reported java.lang.IllegalStateException:Couldn ' t read row 0, col-1 from Cursorwindow. Make sure the Cursor was initialized corre
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 the browser windowSecond, fo
How does Javascript obtain and set the height and width of a div, and is compatible with any browser, if you are interested, you may wish to see the following code and perhaps unexpected gains. How does Javascript get and set the height and width of p and be compatible with any browser? Check the Code:
The Code is as follows:
Http://www.itdos.com
Http://www
. Screen. WidthAvailable screen workspace Height: window. Screen. availheightAvailable workspace width: window. Screen. availwidth
HTML quasi-disconnection location: scrollleft, scrollwidth, clientwidth, offsetwidthScrollheight: Get the migration transformation height of the object.Scrollleft: set or obtain the interval between the left side of the object and the leftmost side of the currently visible content in the window.Scrolltop: sets or obtains t
the DOM, and the value is the same as offsetx/y, which is the same as Firefox used to replace the offsetx/y, the base point is the upper-left corner of the border, but one condition is that The DOM that is triggered needs to be set to position:relative or Position:absolute, otherwise the distance from the upper-left corner of the relative HTML document area is returnedCompatibility: IE6/7/8 not supported, opera does not support, IE9/10 and Chrome, Safari supportscreenx/y:Screenx/y gets the dist
offsetx/y, the base point is the upper-left corner of the border, but one condition is that The DOM that is triggered needs to be set to position:relative or Position:absolute, otherwise the distance from the upper-left corner of the relative HTML document area is returnedCompatibility: IE6/7/8 not supported, opera does not support, IE9/10 and Chrome, Safari supportscreenx/y:Screenx/y gets the distance of the trigger point relative to the upper-left corner of the display screen, and does not ch
Actually get the mouse position is a word of things, but if you do not understand the differences between browsers, the whole process will make people very depressed, the difference in with:
1.IE the distance of the X and Y axes is obtained by event.x and EVENT.Y respectively;
The distance of the X and Y axes is obtained by Event.pagex and Event.pagey respectively;
2.IE the position obtained by this method does not calculate the scroll bar roll over p
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.