在 Bootsrap 轮播中显示带有图表的 iframe 时,Firefox 会出错
我创建了一个带有 Bootstrap 轮播的网站。在此轮播中,我尝试显示两个 iframe,其中一个网站包含来自 Chartjs.org 的图表。
在 Firefox 91.1.0esr(32 位)上,我收到此错误:
Uncaught
Exception { name: "NS_ERROR_FAILURE", message: "", result: 2147500037, filename: "https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js", lineNumber: 13, columnNumber: 0, data: null, stack: "fit@https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js:13:146316
该错误不会出现在 Chrome 和 Edge 中。这是 Firefox 中的一个错误吗?
带有轮播的站点:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<div class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active" data-bs-interval="5000">
<iframe src="./site.html" title="Iframe1"></iframe>
</div>
<div class="carousel-item" data-bs-interval="5000">
<iframe src="./site.html" title="Iframe2"></iframe>
</div>
</div>
</div>
有图表的网站:
const labels = [
'January',
'February',
'March',
'April',
'May',
'June',
];
const data = {
labels: labels,
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45],
}]
};
const config = {
type: 'line',
data: data,
options: {}
};
const myChart = new Chart(
document.getElementById('diagramm'),
config
);
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>
<canvas id="diagramm"></canvas>
I create a site with a Bootstrap carousel. In this carousel I try to show two iframes with a site whitch contains a chart from chartjs.org.
On Firefox 91.1.0esr (32-Bit) I get this error:
Uncaught
Exception { name: "NS_ERROR_FAILURE", message: "", result: 2147500037, filename: "https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js", lineNumber: 13, columnNumber: 0, data: null, stack: "fit@https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js:13:146316
The error does not appear in Chrome and Edge. Is it a Bug in Firefox?
The site with the carousel:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<div class="carousel slide carousel-fade" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active" data-bs-interval="5000">
<iframe src="./site.html" title="Iframe1"></iframe>
</div>
<div class="carousel-item" data-bs-interval="5000">
<iframe src="./site.html" title="Iframe2"></iframe>
</div>
</div>
</div>
The site with the chart:
const labels = [
'January',
'February',
'March',
'April',
'May',
'June',
];
const data = {
labels: labels,
datasets: [{
label: 'My First dataset',
backgroundColor: 'rgb(255, 99, 132)',
borderColor: 'rgb(255, 99, 132)',
data: [0, 10, 5, 2, 20, 30, 45],
}]
};
const config = {
type: 'line',
data: data,
options: {}
};
const myChart = new Chart(
document.getElementById('diagramm'),
config
);
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"></script>
<canvas id="diagramm"></canvas>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论