简体   繁体   English

Internet Explorer 7/8的计时-图表未显示

[英]Timing with Internet Explorer 7/8 - Chart not shown

I have one Highchart and some other functions in one script. 我在一个脚本中有一个Highchart和其他一些功能。 It works fine in Firefox and IE > 8, but with IE 7/8 there is a timing problem, the chart is not shown at all. 它在Firefox和IE> 8中运行良好,但是在IE 7/8中存在计时问题,该图表根本没有显示。

My workaround is 我的解决方法是

setTimeout( function() {    
   .. my other functions
}, 5000 );  

but it is not a good practice and even not sure, if 5000 is enough in every case. 但这不是一个好习惯,甚至不能确定在每种情况下5000是否足够。

Is there a way to detect, when Highchart is ready and the script can go on with other functions? 当Highchart准备好并且脚本可以继续执行其他功能时,是否有方法可以检测?

You can listen for the chart load event ... 您可以监听图表加载事件 ...

$(document).ready(function () {
    $("#container").highcharts({
        events: {
            load: function () { myOtherFunctions(); }
        }
    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM