JavaScript comes in mind

Source: Internet
Author: User

The width of the screen height that the Availheight,availwidth window can use

The length here is minus the length of the status bar, by default, Windows availheight is smaller than the height, if the status bar to move to the left and right side, availwidth will become smaller

Judging the browser

IE browser before using MSIE can judge, but IE11 can't judge, the fourth line is the new Judgment method

1         varUa=navigator.useragent;2         varBrowser="Unknown";3 function Check () {4             if(!! Window. ActiveXObject | |"ActiveXObject" inchwindow) {5Browser="IE";6}Else if(Ua.indexof ("Chrome") >-1){7Browser="Chrome";8}Else if(Ua.indexof ("Firefox") >-1){9Browser="Firefox";Ten             } One alert (browser); A}

Two different file name of the JS file, if you have the same method name, but also to use the time, you can use to create a namespace to solve the problem

Method One

var curd= window. Namespace | | {};curd.data=new  function () {    var self=this;    Self.init= function () {        console.log ("curd1 init")    }    self.xx=function () {        console.log ("curd1 xx")    }}

Call

Curd.data.init (); curd.data.xx ();

Method Two

var curd2={    add:function () {        console.log ("");    },    xx:function () {        console.log ("curd2 xx");}    }

Call

Curd2.add (); curd2.xx ();

JavaScript comes in mind

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.