Skip to main content
Question

Using IOL technique to get Chart working

  • October 27, 2019
  • 0 replies
  • 66 views

MarkShnierYou
Forum|alt.badge.img+24
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
------------------------------

  • Registered
  • October 28, 2019
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
------------------------------