Forum Discussion

dhavalu's avatar
dhavalu
Frequent Visitor
10 years ago
Solved

Can we add external javascript file to custom visual?

Hello,

Can we add external javascript file to custom visual?

If yes can anyone point me at some code or link.

I have tried few things like $.getScript(), reference path but no luck.

 

Thanks.

  • Take a look at the QuillWrapper in the textbox visual, it loads javascript dynamically.

    You can refer to a CDN or self hosted (needs to be https)

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    I won't say no but I would be fairly surprised if this was allowed for security concerns alone.

  • Take a look at the QuillWrapper in the textbox visual, it loads javascript dynamically.

    You can refer to a CDN or self hosted (needs to be https)

    • Anonymous's avatar
      Anonymous
      Not applicable

      vincent_1234 hello, sorry for jumping on someone elses thread.  When you say "textbox visual", do you mean the basic textbox which is available in the ribbon bar.  Or are you referring to a Custom Visual?  Im trying to embed a short java script to recall a map from an external https website.

       

      Thanks!

      • Anonymous's avatar
        Anonymous
        Not applicable

        I was able to use getScript to grab the leaflet library for a mapping visual         

                     $.getScript("https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js", function (data, textStatus, jqxhr) {
        //do stuff
        }

        Alex