本文介绍了在Firefox中使用morris.js脚本不再回答任何错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在使用morris.js库 http://www.oesmith.co.uk /morris.js/以便为网站创建图表.它适用于Opera,Internet Explorer和Google Chrome.

I am using the library morris.js http://www.oesmith.co.uk/morris.js/ in order to create charts for a website.It works on Opera, Internet Explorer and Google Chrome.

在Firefox中,它会立即随机崩溃.

In Firefox, it randomly crashes instantly.

脚本面板告诉我,它在此处崩溃:

Script Panel tells me, it crashes here:

secondsSpecHelper = function(interval) {
    return {
        span: interval * 1000,
        start: function(d) {
        return new Date(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(),
        d.getMinutes());
    },
fmt: function(d) {
    return "" + (Morris.pad2(d.getHours())) + ":" + (Morris.pad2(d.getMinutes())) + ":" +
    (Morris.pad2(d.getSeconds()));
},
incr: function(d) {
    return d.setUTCSeconds(d.getUTCSeconds() + interval);
}
};

有什么想法,如果其中任何一个功能在Firefox中不起作用?还是可能导致此崩溃的原因?

Any ideas, if any of those functions are NOT working in Firefox? Or what could cause this crash?

我收到标准的Firefox错误:

I get the standard Firefox Error:

推荐答案

已修复! Morris.js和Mozilla尝试将"xLabels"属性解析为Datetime,然后进入永久循环.

Fixed! Morris.js and Mozilla tries to parse the "xLabels" attribute as a Datetime, and goes into a forever-loop then.

修复了属性

    parseTime: false

例如:

xxx = new Morris.Line({
    xLabels: 'day',
    parseTime: false
});

这篇关于在Firefox中使用morris.js脚本不再回答任何错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 09:28