- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有这个morris.js
我用随机值填充的图表(示例中提供的值)。而它在 localhost
中完美呈现,一旦我上传到生产服务器上,它就不再起作用了。
JS代码
new Morris.Line({
element: 'daily-chart',
data: [
{ y: '2006', a: 100, b: 90 },
{ y: '2007', a: 75, b: 65 },
{ y: '2008', a: 50, b: 40 },
{ y: '2009', a: 75, b: 65 },
{ y: '2010', a: 50, b: 40 },
{ y: '2011', a: 75, b: 65 },
{ y: '2012', a: 100, b: 90 }
],
xkey: 'y',
ykeys: ['a', 'b'],
labels: ['Series A', 'Series B']
});
HTML 代码
<div id="daily-chart" style="height: 350px; width: 1000px">
</div>
在 Chrome/Opera 中
尽管 width
和height
设置在#daily-chart
<div>
,尺寸设置不正确。我只看到图表的一部分,其余部分被隐藏。尽管<div id="daily-chart" style="height: 350px; width: 1000px">
,它的宽度约为50px .
在 Firefox 中
脚本变得繁忙或根本不响应。我收到以下消息:A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.
与 Continue|Stop script
选择和浏览器卡住。它指出该行是 1164
这是一个 while 条件:
while ((t = d.getTime()) <= dmax) { // <-- 1164 line
if (t >= dmin) {
ret.push([spec.fmt(d), t]);
}
spec.incr(d);
}
控制台中没有错误或任何错误,除非我停止脚本时得到:
Error: Script terminated by timeout at:
Morris.labelSeries@https://<url>/js/uncompressed/morris.js:1164:1
Morris.Line</Line.prototype.drawXAxis@https://<url>/js/uncompressed/morris.js:930:11
Morris.Line</Line.prototype.draw@https://<url>/js/uncompressed/morris.js:890:9
Morris.Grid</Grid.prototype.redraw@https://<url>/js/uncompressed/morris.js:472:9
Morris.Grid</Grid.prototype.setData@https://<url>/js/uncompressed/morris.js:338:9
Grid@https://<url>/js/uncompressed/morris.js:102:7
Line@https://<url>/js/uncompressed/morris.js:726:7
Line@https://<url>/js/uncompressed/morris.js:724:9
@https://<url>/<path/to/webpage>:1171:9
生产服务器使用HTTPS协议(protocol),PHP版本(不认为这有任何关系)是5.4.29
在开发和 5.4.30
在产品上。据我所知,这些是唯一的区别。
是什么导致了这个问题?
最佳答案
如果您仍在尝试找出解决方案,请确保检查所有已链接的样式表以及 jquery 插件的链接。
例如:
<link href="http://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
应替换为
<link href="https://code.ionicframework.com/ionicons/2.0.0/css/ionicons.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
等等。
关于javascript - morris.js 图表在生产服务器上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25550627/
今天有小伙伴给我留言问到,try{...}catch(){...}是什么意思?它用来干什么? 简单的说 他们是用来捕获异常的 下面我们通过一个例子来详细讲解下
我正在努力提高网站的可访问性,但我不知道如何在页脚中标记社交媒体链接列表。这些链接指向我在 facecook、twitter 等上的帐户。我不想用 role="navigation" 标记这些链接,因
说现在是 6 点,我有一个 Timer 并在 10 点安排了一个 TimerTask。之后,System DateTime 被其他服务(例如 ntp)调整为 9 点钟。我仍然希望我的 TimerTas
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我就废话不多说了,大家还是直接看代码吧~ ? 1
Maven系列1 1.什么是Maven? Maven是一个项目管理工具,它包含了一个对象模型。一组标准集合,一个依赖管理系统。和用来运行定义在生命周期阶段中插件目标和逻辑。 核心功能 Mav
我是一名优秀的程序员,十分优秀!