Including external libraries

  • Klaus79
        vor 4 Jahren #19997

        How can I include JS libraries hosted on an external source?

        In other words: where do I have to add <script></script> tags so that the included library will be available for every controller?

        Is it possible to extend the index.html manually?

        Mathieu Roll
            Has successfully completed the online course Introduction
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Advanced (300)
            Has successfully completed the online course Basics (100)
          vor 4 Jahren #19998
          Up
          3
          Down
          ::

          Hello Klaus,

           

          you can create a Library and in the Include Script you can extend the header as followed.

           

          addAfterInitHandler(
          function() {
          var script = $(‘<script>’)
          .attr(‘type’,’text/javascript’)
          .attr(‘src’, ‘https://maps.googleapis.com/maps/api/js?key=yourkey&#8217;);
          $(‘head’).append(script);
          });

        Ansicht von 2 Beiträgen – 1 bis 2 (von insgesamt 2)

        You must be logged in to reply to this topic.