1
0
-1

Greetings,


I would like to include an external javascript reference in the HTML Header section when using composer.

Does anybody know how to do that?

The external references are the google API. For instance,

<script type="text/javascript" src="https://www.google.com/jsapi"></script>

Where in Composer can I do that?

Also, how can amend the  Javascript "onLoad" event to include custom JS functions?

Thank you in advance for your assitance.

Carles


    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      There are at least two ways to do this...

      The first approach dynamically adds the script with jQuery.  Add a business rule to the form and set the Triggering Conditions to Trigger rule at initialization.  Inside the script, add the following code:

          $.getScript("www.mydomain.com/library.js");

      Note that you must include the full path to the Javascript library and not just the context.

      The second approach uses the Page Tracking feature in Transact Manager.  After your form is published to TM, navigate to the Form Configuration and click on Page Tracking.  Toggle Use Form Page Tracking to ON and include the Javascript library in the Form Page Tracking Script.  You can specify whether you want the script included in the <HEAD> or after the <HTML> tag.

          <script type="text/javascript" src="www.mydomain.com/library.js"></script>

      1. Carles Tierno

        Thank you very much Kevin for your insights. 

        I'll implement this accordingly.

        Kind Regards

      CommentAdd your comment...