Live Chat Script breaking concrete

Permalink
Hi,

I'm trying to add a live chat script from stardevelop.com.

Could someone advise the best way to add the script? I am simply adding it as a html block in the header, but this is breaking concrete and it won't let me remove/edit the page unless I revert to a previous page version.

Here is the code:
<script type="text/JavaScript" src="http://websitedomain.com/livehelp/scripts/jquery-latest.js"></script>
<script type="text/javascript">
<!--
   var LiveHelpSettings = {};
   LiveHelpSettings.server = 'websitedomain.com';
   LiveHelpSettings.embedded = true;
   (function(d, $, undefined) { 
      $(window).ready(function() {
         var LiveHelp = d.createElement('script'); LiveHelp.type = 'text/javascript'; LiveHelp.async = true;
         LiveHelp.src = ('https:' == d.location.protocol ? 'https://' : 'http://') + LiveHelpSettings.server + '/livehelp/scripts/jquery.livehelp.js';
         var s = d.getElementsByTagName('script')[0];
         s.parentNode.insertBefore(LiveHelp, s);
      });
   })(document, jQuery);
-->


I'm a system admin rather than a website coder, so simple terms would be great!

Thanks
Chris

 
JohntheFish replied on at Permalink Reply
JohntheFish
The main issue is loading a copy of jQuery that will conflict with concrtete5's own copy of jQuery when that gets loaded. The consequence will be a duplicate declaration (you can probably see it in the browser developer console).

The easy answer is the Load.UI block. It loads more than you need, but does not argue with c5 and you could edit a stripped down version.
http://www.concrete5.org/marketplace/addons/load-jquery-ui/...

The answer that costs is to use jQuickie as it has plentiful options to set up the environment and sandbox your code.
http://www.concrete5.org/marketplace/addons/jquickie/...

A longer process is to develop your own block with php to addHeaderItem for the c5 version of jQuery and wrap your javascript.
jamesleech replied on at Permalink Reply
jamesleech
Hi,

Did you ever get star chat working?

I am quoting on a job and am wondering if this is a better option than cometchat or hichat.

John - your suggestions give me confidence that all will be well.
fullyfurnished replied on at Permalink Reply
Hi,

I still have a very limited knowledge of javascript - But I did solve it quite easily by just removing any reference to Jquery on the chat script (the top line), so that it used concrete's own copy rather than trying to call its own version.

Worked like a treat! We don't actually use the concrete site anymore, but we use the same live chat system on 2 other websites with around 10 staff, can't fault it!

Regards
C