Forum Discussion

MarkShnier__You's avatar
MarkShnier__You
Qrew Champion
5 years ago

Using IOL technique to get Chart working

I'm trying to se if I can get a chatbot working.  I presume (hope) that this can be done using the Image Onload Technique.  I set up IOL on a form and got an alert to pop up when the page loaded, so I know the basic IOL is working.

I was provided some code to insert into the Code page.  But when I substituted the chat code into that same module.js code page (instead of he simple alert code), nothing happens when the page loads.    Here is the code they gave me (with the license changed).  Any ideas?

<!-- Start of LiveChat (www.livechatinc.com) code -->

<script type="text/javascript">

  window.__lc = window.__lc || {};

  window.__lc.license = 9999999;

  (function() {

    var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;

    lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';

    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);

  })();

</script>

<noscript>

<a href="https://www.livechatinc.com/chat-with/99999999/" rel="nofollow">Chat with us</a>,

powered by <a href="https://www.livechatinc.com/?welcome" rel="noopener nofollow" target="_blank">LiveChat</a>

</noscript>

<!-- End of LiveChat code -->



------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
markshnier2@gmail.com
------------------------------

4 Replies

  • The module.js page should contain only javascript/jQuery code, but the code provided above contains HTML. I think you need to either strip out all of the text/HTML content from the above code or use a javascript/jQuery function to write the HTML to the page. To confirm this, try using just this portion of the code in your module.js file and see if it works:
    window.__lc = window.__lc || {};
    window.__lc.license = 9999999;
    
    (function() {
    
      var lc = document.createElement('script');
      lc.type = 'text/javascript';
      lc.async = true;
      lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(lc, s);
    
    })();



    ------------------------------
    -Tom
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Qrew Champion
      Amazing, it totally worked.  I was also able to embed a dummy form on a dashboard as a Web Page Widget and get the chat box on my Dashboard.  Wonderful.

      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      markshnier2@gmail.com
      ------------------------------
      • GiuseppeMacri's avatar
        GiuseppeMacri
        Qrew Captain
        Hey Mark,

        How does LiveChat work for your QB implementation? I was thinking about doing something similiar on a form and was wondering A) if it works well and B) is the above code repurposable based on license number.

        Also is LiveChat a good service?

        -Giuseppe​

        ------------------------------
        GMacri
        ------------------------------