[英]javascript not working in IE11
我正在嘗試使用此儀表 - https://canvas-gauges.com
我用這個儀表創建了 javascript,它在 chrome 和 Firefox 中運行良好,但在 IE 11 中不起作用
有我的代碼:
<!DOCTYPE html>
<html>
<head>
<title>Gauges as Components</title>
<script src="http:////cdn.rawgit.com/Mikhus/canvas-gauges/gh-pages/download/latest/all/gauge.min.js"></script>
</head>
<body>
<h1 align="center" >CPU Dashboard</h1>
<canvas id="canvas-id" >
</canvas>
<script>
var gauge = new RadialGauge({
renderTo: 'canvas-id',
animationRule: "linear",
animationDuration: 1500,
needleCircleInner: false,
needleCircleOuter: true,
needleCircleSize: 7,
needleWidth: 2,
needleType: "arrow",
borders: false,
borderShadowWidth: 0,
colorPlate: "#fff",
highlights: [
{
"from": 160000,
"to": 200000,
"color": "rgba(255,216, 0, 1)"
},
{
"from": 200000,
"to": 268000,
"color": "rgba(255, 50, 50, .75)"
}
],
strokeTicks: true,
minorTicks: 2,
majorTicks: [
"0",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
"268000"
],
valueDec: 0,
valueInt: 5,
maxValue: 268000,
minValue: 0,
value:150000,
units: "mhz",
title:"CPU UTIL",
height: 300,
width: 300
}).draw();
</script>
</body>
</html>
我是 javascript 新手。 我做錯了什么?
提前致謝!
我只使用本地 js 文件,現在它可以在 IE 中使用。
最近,當我的 ES6 代碼在 IE11 上不起作用時,我遇到了問題。
我通過Babel 重新編譯器轉換了我的代碼,這幫助我讓一切都像在 Chrome 中一樣工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.