Home > front end >  Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Windows' : paramete
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Windows' : paramete

Time:01-06

A js function, the code is as follows:
 
Ol. Dom. OuterWidth=function (element) {
If (the navigator userAgent. IndexOf (" MSIE ")!=1) {
Var element width=[0]. OffsetWidth;
Var style=element [0]. CurrentStyle | | window. GetComputedStyle (element [0]).
}
The else {
Var width=element. The offsetWidth;
Var style=element. CurrentStyle | | window. GetComputedStyle (element);
}
Width +=parseInt (style. MarginLeft, 10) + parseInt (style. MarginRight, 10);

Return the width;
};


Microsoft Edge browser (version 87.0.664.66 (official version, 64) error, error code in the window. The getComputedStyle (element); This error message is: ol - debug. Js: 47206 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Windows' : 1 is not of the type parameter' Element ',
  • Related