Forum Discussion

nibo's avatar
nibo
Mentor
11 years ago

Add external JS file with liaAddScript

Hi guys,   is it possible to pass some kind of parameter to <@liaAddScript> where I can define an url to an external JS file?   In my current use case the file is the jquery-cookie plugin and is ...
  • PaoloT's avatar
    11 years ago

    Hi Nikolay,

     

    I don't think you can do this in the <@LiaAddScript> , but maybe what you can do is to use LiaAddScript to dynamically load  the external script and then evalutate it, or use something like jQuery.getScript

     

    So your code can be then written when you are sure that the external library has actually been loaded. Of course there are security implications when doing this but in this case it should be okay as you are loading a script you actually control.

     

    Hope this helps,