highchart loaded twice while making ajax call

2019-03-05 11:05发布

I am making graph with highcharts . There is a tab and page is loaded using the following code

   function loadSimulation()
    {
     var globalName = $('#locationselect').find(":selected").text();
     var affiliates = $('#location ').find(":selected").text();
      var URL="loadSimulationpage.action;" 

      $.ajax({
             url : URL,
             type : "Get",
    //data: $('form#whatIf').serialize(),

    success : function(response) {

        $('#moduleHolderDiv').empty();
        alert($('#moduleHolderDiv').html())
        $('#moduleHolderDiv').append(response);

        loadModules('normalizingDiv');
    }
});

};

This response contains the page with code of highcharts. Now the problem is if i include the lobrary in response page so when the next time tab is clicked the library is reloaded hence throwing the error and if i include it in parent file from where the ajax call is made it is not able to find the library at all

0条回答
登录 后发表回答