2
jquery of chatbox interferes with javascript of homepage it is embedded
Problem reported by TK - 4/5/2022 at 11:34 AM
Submitted
We have found jquery (used for the chat widget) interacting with the existing javascript of the homepage the widget is embeeded in. as per this link: https://api.jquery.com/jquery.noconflict/ we should be able to introduce jquery.noconflict to avoid those issues, but didn't yet manage to get it properly done. 

Anyone had the same issue before and a solution to this?

1 Reply

Reply to Thread
0
TK Replied
Reaching out again if anyone has this problem as well. the Smartertrack javascript widget has conflicts when implemented alongside other javascript libraries, below code does not work with the widget but with other code. if anyone has solved this please let me know.

<script type="text/javascript">
( function($) {
    // we can now rely on $ within the safety of our "bodyguard" function
    $(document).ready( function() { 
    var c = document.createElement('script');
      c.type = 'text/javascript'; c.async = true;
      var s = document.getElementsByTagName('script')[0];
      s.parentNode.insertBefore(c,s);
   } );
} ) ( jQuery );
</script>
<div id="chattab"></div>

Reply to Thread