How can I fix Highcharts error #13?

前端 未结 9 2213
迷失自我
迷失自我 2020-12-11 15:59

I use highchart so, the user can close and open the chart page and redraw the chart, in some case give me this error, how can I fix it, Thanks Here is my code



        
9条回答
  •  借酒劲吻你
    2020-12-11 16:34

    This is an old question, but none of the answers are really satisfactory in my opinion.

    I would suggest checking to make sure the chart div exists before rendering the chart.

    if($('#'+id).length){ $('#'+id).highcharts({});}
    

提交回复
热议问题