You can connect JLive! Chat to any non-Joomla website using the plain HTML code from below.
Copy and paste this code into the <head> section of your non-Joomla website:
| Code: |
<style type="text/css"> #livechat_iframe { position: absolute; }
body > #livechat_iframe { position: fixed; }
.minimized { height: 38px; } </style> <script language="Javascript"> var alreadySetupFlag = false;
function getCurrentScheme() { var curUri = String(document.location.href);
if(curUri.indexOf('https://') > -1) { var scheme = 'https://'; } else { var scheme = 'http://'; }
return scheme; } function setupLiveChat() { if(alreadySetupFlag) { return false; }
alreadySetupFlag = true; var jsFilePath = getCurrentScheme()+'www.<your-domain-here>.com/components/com_livechat/js/livechat_v3.js'; var jsFile2Path = getCurrentScheme()+'www.<your-domain-here>.com/index.php?option=com_livechat&view=popup&do_not_log=true&format=raw&task=check_proactive';
var body = document.getElementsByTagName('head').item(0); var script = document.createElement('script'); script.src = jsFilePath; script.type = 'text/javascript'; script.id = 'livechat_javascript'; body.appendChild(script);
var readyFuncRunFlag = false; var readyFunc = function() { if(!readyFuncRunFlag) { readyFuncRunFlag = true;
injectTrackerImg();
// Inject pro-active chat js file var script2 = document.createElement('script'); script2.src = jsFile2Path; script2.type = 'text/javascript';
body.appendChild(script2); } return true; }
script.onreadystatechange = function () { if (script.readyState == 'complete') { readyFunc(); } } script.onload = function () { readyFunc(); } }
function injectTrackerImg() { var body = document.getElementsByTagName('body').item(0); var userId = ''; var fullName = ''; var username = ''; var email = '';
var trackImg = document.createElement('img'); var trackImgUri = getCurrentScheme()+'www.<your-domain-here>.com/components/com_livechat/track.php?user_id='+URLEncode(userId)+'&full_name='+URLEncode(fullName)+'&username='+URLEncode(username)+'&email='+URLEncode(email); if(document.referrer) { trackImgUri += '&referrer='+URLEncode(document.referrer); }
trackImg.src = trackImgUri; trackImg.alt = ''; trackImg.style.width = '1px'; trackImg.style.height = '1px'; trackImg.style.border = 'none';
body.appendChild(trackImg); }
if (document.addEventListener) { document.addEventListener("DOMContentLoaded", function(){ setupLiveChat() }, false) } else if (document.all && !window.opera) { document.write('<script type="text/javascript" id="contentloadtag" defer="defer" src="javascript:void(0)"><\/script>')
var contentloadtag=document.getElementById("contentloadtag");
contentloadtag.onreadystatechange=function() { if(this.readyState=="complete") { setupLiveChat() } } }
window.onload=function(){ setTimeout("setupLiveChat();", 5) } </script>
|
Copy and paste this code into the <body> section of your non-Joomla website where you wish to display an online/offline image:
| Code: |
<script language="Javascript"> var curUri = String(document.location.href);
if(curUri.indexOf('https://') > -1) { var scheme = 'https://'; } else { var scheme = 'http://'; }
var imgSize = 'large'; var opertorIdList = ''; var routeId = '';
var livechatImgUri = scheme+'www.<your-domain-here>.com/modules/mod_jlivechat/dynamic.php?size='+imgSize+'&operator='+opertorIdList+'&routeid='+routeId; var livechatImg = '<a href="javascript:void(0);" onclick="requestLiveChat(\'http://www.<your-domain-here>.com/index.php?option=com_livechat&view=popup&tmpl=component&popup=1\');"><img src="'+livechatImgUri+'" border="0" alt="" /></a>';
document.writeln(livechatImg); </script>
|
The HTML pieces are also attached as plain text files for you to copy and paste.
This attachment is hidden for guests. Please login or register to see it.