Additional Widget Options

Within the code generated by Airdesk, you can add extra widget handling options.

Example of a code generated by Airdesk that is placed on the client's page:

 <script defer> 

      (function (a, i, r, d, e, s, k) { 

        a.airdesk = { settings: { cpid: "TEST-EXAMPLE" } }; 

        e = i.getElementsByTagName("head")[0]; 

        s = i.createElement("script"); 

        s.async = 1; 

        s.src = r + d; 

        e.appendChild(s); 

        a.$airdeskOnLoad = () => { 

          var {$airdesk} = a;

//Extra options are added below this line 

}; 

      })(window, document, "https://script.airdesk.ai/v1/", "air.js"); 

    </script> 

To use widget functions with javascript, these must always be called within a load event.

window.addEventListener ('load', function () {})

You can call up these options after initialization of the widget like for example make the widget, after loading on the page, automatically open the form as follows:

 <script defer> 

      (function (a, i, r, d, e, s, k) { 

        a.airdesk = { settings: { cpid: "TEST-EXAMPLE" } }; 

        e = i.getElementsByTagName("head")[0]; 

        s = i.createElement("script"); 

        s.async = 1; 

        s.src = r + d; 

        e.appendChild(s); 

        a.$airdeskOnLoad = () => { 

          var {$airdesk} = a;

//Opções extra são adicionadas abaixo desta linha 

$airdesk.open() 

}; 

      })(window, document, "https://script.airdesk.ai/v1/", "air.js"); 

    </script> 

Or, it's also possible to call the options in the client's javascript after the widget is initialized, as follows:

window.$airdesk.open(); 

Last updated