loadScriptByUrl

This function allows to load in scripts dynamically and then perform an action on the scripts successful loading

Syntax

loadScriptByUrl (url, options)

Arguments

url

(Required)

The url to the script you want to dynamically load in

options

The jQuery $.ajax options to pass. You can not override the following options

  • dataType
  • cache
  • url

Return

This function returns the jQuery jqXHR object.

Examples

The following code will chain load in 3 libraries and then execute an arbitrary piece of code

report.api.loadScriptByUrl("http://azure.calumo.com/assets/js/fusioncharts/FusionCharts.HC.js").done(function () {
    report.api.loadScriptByUrl("http://azure.calumo.com/assets/js/fusioncharts/FusionCharts.HC.js").done(function () {
        report.api.loadScriptByUrl("http://azure.calumo.com/assets/js/fusioncharts/FusionCharts.HC.Charts.js").done(function () {
            // Do something now all your scripts are loaded
        });
    });
});