[英]Cross-Origin Read Blocking (CORB) blocked cross-origin response https://cdnjs.com/libraries/Chart.js
I want to use chart.js but im getting this error anyone willing to help me solve the problem?我想使用chart.js但我得到这个错误有人愿意帮我解决问题吗?
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://cdnjs.com/libraries/Chart.js with MIME type text/html.跨域读取阻止 (CORB) 阻止了 MIME 类型为 text/html 的跨域响应https://cdnjs.com/libraries/Chart.js 。 See https://www.chromestatus.com/feature/5629709824032768 for more details.
有关详细信息,请参阅https://www.chromestatus.com/feature/5629709824032768 。
Here is my js.这是我的js。
const Chart = document.getElementById("lineChart");
console.log(Chart);
let lineChart = new Chart(Chart,{
type: 'line',
data: {
labels: ["January", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "My First dataset",
fill: false,
lineTension: 0.1,
backgroundColor: "rgba(75, 192, 192, 0.4)",
borderColor: "rgba(75, 192, 192, 1)",
borderCapStyle: 'butt',
borderDash: [],
borderDashOffset: 0.0,
borderJoinStyle: 'miter',
pointBorderColor: "rgba(75,192,192,1)",
pointBackgroundColor: "#fff",
pointBorderWidth: 1,
pointHoverRadius: 5,
pointHitRadius: 10,
data: [65, 59, 80, 81, 56, 55, 40],
}
]}
});
Thanks in advance!提前致谢!
Based on comment, You are importing the html page and not the js file.根据评论,您正在导入 html 页面而不是 js 文件。
Here is what you can do to resolve the issue.以下是您可以采取的措施来解决此问题。
After visiting https://cdnjs.com/libraries/Chart.js you can,访问https://cdnjs.com/libraries/Chart.js后即可,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.