The script url is returning a 404
The LiveHelpNow script url is returning a 404 and some of our elements are loading slow. How can I prevent this in the future.
Our Live chat script is designed to load last, after all of your elements have loaded on the webpage. There a slim chance of your server not being able to access our script causing your elements to load slightly slower than usual. Here is a resolution to the issue if you do encounter these issues.
(This is very slim and we have only had a few clients who have had this issue, please do not add this code unless you have experienced these issues)
(NOTE: The following script is for chat button only and is not compatible with helpOut tab)
1. Please visit http://www.livehelpnow.net/blog/example.html for an example of our code.
2. The following code must be within the <head> tag of your document:
<script type="text/javascript">
if (window.addEventListener) {
window.addEventListener('load', function () {
var lhnscript = document.createElement('script');
lhnscript.src = "//www.livehelpnow.net/lhn/widgets/chatbutton/lhnchatbutton-current.min.js";
lhnscript.id = "lhnscript";
document.getElementById("chatContainer").appendChild(lhnscript);
});
var lhnFinished = true;
} else {
window.attachEvent('onload', function () {
var lhnscript = document.createElement('script');
lhnscript.src = "//www.livehelpnow.net/lhn/widgets/chatbutton/lhnchatbutton-current.min.js";
lhnscript.id = "lhnscript";
document.getElementById("chatContainer").appendChild(lhnscript);
});
}
</script>
3. Now add the following code where you will want the chat button to be:
<script type="text/javascript">
// Live Chat Now
var lhnAccountN = "LHNACCOUNTNUMBER-1";
var lhnButtonN = LHNBUTTONNUMBER;
var lhnChatPosition = 'default';
var lhnWindowN = 0;
var lhnDepartmentN = 0;
var lhnInstantLoad = true;
var lhnFinished = false;
</script>
<div id="chatContainer"></div>
4. Replace LHNACCOUNTNUMBER with your numeric account number and LHNBUTTONNUMBER with the number of your button for display.
This is it, now if your server cannot find the script it will load all elements on your website without issues.