Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
$(document).ready(
  function() {
    $.getScript("https://mywebsite.com/livechat/lib/livechatagentsdk.js", 
      function () {
        LIVECHATSDK.SDK.Init("https://mywebsite.com/livechat/").then(
          function() {
              // CTLive Agent's SDK library loaded
              // LibraryCall library Initializationinitialization...
              LIVECHATSDK.LIVECHAT.init(
                {
                  "nickname": "Agent1",
                  "isAgent": true,
                  "id": "USER_AGENT1",
                  "channel": "web"
                }
              ).then(
                function() {
                  //console.log("[SUCCESS] Initialization completed successfully");
                },
                function() {
                   //console.error(" [ERROR] Initialization failed");
                }
              );
          }
        ).catch(
          function(err) {
            console.error(err);
          }
        );
      }
    );
  }
);

...