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