多個Highcharts我這就要求使用jquery.load其他網頁母版頁,例如裝入有jquery.load
$("#loading").show();
$("#arena").load('Project.prx?PID=' + dataReport);
$("#loading").hide();
(Project.prx是像ColdFusion的一個內部CGI語言,並且它抽出HTML和JavaScript)。
在瀏覽器的調試器,我得到錯誤信息像我點擊一個鏈接,每次下,即
Uncaught Highcharts error #16: www.highcharts.com/errors/16
Highcharts網站開通Ë說,這個錯誤的:
Highcharts Error #16
Highcharts already defined in the page
This error happens the second time Highcharts or Highstock is loaded in the same page, so the Highcharts namespace is already defined. Keep in mind that the Highcharts.Chart constructor and all features of Highcharts are included in Highstock, so if you are running Chart and StockChart in combination, you only need to load the highstock.js file.
由於我使用jQuery的load()和針對當前文檔中一個div,它聲稱我加載的第二個實例公平的呼籲Highcharts命名空間。不過,這是我想要做的。
所以任何想法如何等Highcharts頁面加載到一個與Highcharts命名空間的現有實例?
LATER
我已經取得了一些成功不是把highcharts控制器,只有在目標和發行
$("#loading").show();
$("#arena").empty();
delete(Highcharts);
$("#arena").load('Project.prx?PID=' + dataReport);
$("#loading").hide();
然而,這並沒有在每個實例證明是成功的。
問題不是你正在加載兩個圖表,而是兩個highcharts代碼......我要做的是從Project.prx中去掉腳本標籤以避免這種情況。如果您需要在頁面上自行顯示Project.prx,則只有在請求不是AJAX調用時才添加腳本標記... – Salketer 2014-11-21 07:27:21