Skip to content

loadScriptByUrl

The loadScriptByUrl method dynamically loads in scripts which can then be actioned.

Syntax

loadScriptByUrl (url, options)

Arguments

url : string : (required)

The url to the script to be dynamically loaded in.

options : object

The jQuery $.ajax options to pass. Note that the following options cannot be overidden:

  • 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
        });
    });
});
Back to top