Customer Banners (Ads) - SpiceUp. AX and SpotfireX Disclaimer



If you find this site useful and you want to support, buy me a coffee   to keep this site alive and without ads.

Add a javascript resource file

//add a scripts to head
$.getScript("https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js", function () { 
   alert("your resource is ready!")
})


//add multiple scripts to head (nested when they depend on each other)
$.getScript("https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.min.js", function () { 
   $.getScript("https://datatables.net/release-datatables/extras/TableTools/media/js/TableTools.min.js",function(){
      alert("your resources are ready!")
      })
})

2 comments:

Anonymous said...

Can you please tell how to add resources in Spotfire....
I cant add resources in java script..
if possible please attach a screenshot....please

Jose Leviaguirre said...

Sometimes it work, but some times this technique does not depending on the resource. For example, I tried importing d3.js but no luck but it works with other resources, like the one I use for the gauge.

Thing does not work probably because by default, javascript needs to be unobtrusive and the spotfire engine parses the resource before loading it

Maybe if the Spotfire admin changes the setting from Administration Manager>Preferences>(Everyone)>TextArea>TextAreaPreferences>PerformHtmlSanitation:False thing might work