Introduction:


The default LivePerson code are not XHTML compliant. If you are creating XHTML compliant code you may need to alter portions of your code. The following guide explains what changes are required in order to be compliant with XHTML 1.0 Strict standards.
NOTE: Note that the strict requirements of XHTML 1.0 Strict standards may impair certain functionality of your chat button and monitor code experiences.

Instructions:


Declaration Code

The following code needs to be placed before the <html> tag to specify that 4.01 Strict standards are being used.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Button Tag

The following code is a sample of a compliant chat button.Replace SERVERDOMAIN with your account's server domain. Contact support in the event that you cannot determine the correct server domain.Replace XXXXXXX with your account's site ID.<!--BEGIN LivePerson Button Code-->
<div>
<table border='0' cellspacing='2' cellpadding='2'><tr><td align="center"></td><td align='center'>
<a id="_lpChatBtn" href='https://SERVERDOMAIN/hc/XXXXXXX/?cmd=file&amp;file=visitorWantsToChat&amp;site=XXXXXXX&amp;
byhref=1&amp;imageUrl=https://SERVERDOMAIN/hcp/Gallery/ChatButton-Gallery/English/General/1a' onclick="javascript:openLPChat();return false;">
<img id='_lpChatBtnImg' src='https://SERVERDOMAIN/hc/XXXXXXX/?cmd=repstate&amp;site=XXXXXXX&amp;channel=web&amp;&amp;ver=1&amp;
imageUrl=https://SERVERDOMAIN/hcp/Gallery/ChatButton-Gallery/English/General/1a' alt="Click To Chat"/></a></td></tr><tr><td>&nbsp;</td><td align='center'><div style="margin-top:5px;">
<span style="font-size:10px; font-family:Arial, Helvetica, sans-serif;"><a id='_lpChatBtnHref' href="http://solutions.liveperson.com/live-chat" style="text-decoration:none; color:#000"><b>Live Chat</b>
</a><span style="color:#000"> by </span><a id='_lpChatBtnHrefLP' href="http://www.liveperson.com/" style="text-decoration:none; color:#FF9900">LivePerson</a></span></div></td></tr><tr><td>&nbsp;</td><td align='center'><a id='_lpChatBtnHrefLPRate' href='http://solutions.liveperson.com/customer-service/?site=XXXXXXX&amp;domain=SERVERDOMAIN&amp;origin=chatbutton' 
onclick="javascript:window.open('http://solutions.liveperson.com/customer-service/?site=XXXXXXX&amp;domain=SERVERDOMAIN&amp;origin=chatbutton&amp;referrer='+escape(document.location));return false;"><img id='_lpChatBtnLPRateImg' src='https://SERVERDOMAIN/hc/XXXXXXX/?cmd=rating&amp;site=XXXXXXX&amp;type=indicator' alt='Customer Service Rating by LivePerson' /></a></td></tr></table>
<script type="text/javascript">//<![CDATA[
function openLPChat(){window.lpButtonCTTUrl='https://SERVERDOMAIN/hc/XXXXXXX/?cmd=file&file=visitorWantsToChat&site=XXXXXXX&imageUrl=https://SERVERDOMAIN/hcp/Gallery/ChatButton-Gallery/English/General/1a&referrer='+escape(document.location);lpButtonCTTUrl=(typeof(lpAppendVisitorCookies)!='undefined'?lpAppendVisitorCookies(lpButtonCTTUrl):lpButtonCTTUrl);lpButtonCTTUrl=((typeof(lpMTag)!='undefined'&&typeof(lpMTag.addFirstPartyCookies)!='undefined')?lpMTag.addFirstPartyCookies(lpButtonCTTUrl):lpButtonCTTUrl);window.open(lpButtonCTTUrl,'chatXXXXXXX','width=475,height=400,resizable=yesraSingleQuote);}function initializeButton(){var el=document.getElementById('_lpChatBtnImgraSingleQuote);if(el!=null){el.name='hcIcon';el.border=0;}el=document.getElementById('_lpChatBtnraSingleQuote);if(el!=null){el.target='chatXXXXXXX';}el=document.getElementById('_lpChatBtnHrefraSingleQuote);if(el!=null){el.target="_blank";}el=document.getElementById('_lpChatBtnHrefLPraSingleQuote);if(el!=null){el.target="_blank";}el=document.getElementById('_lpChatBtnHrefLPRateraSingleQuote);if(el!=null){el.target="_blank";}el=document.getElementById('_lpChatBtnLPRateImgraSingleQuote);if(el!=null){el.border=0;}}initializeButton();
//]]></script>
</div>
<!--END LivePerson Button code-->

Monitor Tag

The following code is a sample of a compliant monitor tag.Replace SERVERDOMAIN with your account's server domain. Contact support in the event that you cannot determine the correct server domain.Replace XXXXXXX with your account's site ID.<!--BEGIN LivePerson Monitor. -->
<script type="text/javascript">
//<![CDATA[
var lpMTagConfig={'lpServer':"SERVERDOMAIN",'lpNumber':"XXXXXXX",'lpProtocol':"https"};function lpAddMonitorTag(src){if(typeof(src)=='undefined'||typeof(src)=='object'){src=lpMTagConfig.lpMTagSrc?lpMTagConfig.lpMTagSrc:'/hcp/html/mTag.js';}if(src.indexOf('http')!=0){src=lpMTagConfig.lpProtocol+"://"+lpMTagConfig.lpServer+src+'?site='+lpMTagConfig.lpNumber;}else{if(src.indexOf('site=')<0){if(src.indexOf('?')<0)src=src+'?';else src=src+'&';src=src+'site='+lpMTagConfig.lpNumber;}}var s=document.createElement('scriptraSingleQuote);s.setAttribute('type','text/javascriptraSingleQuote);s.setAttribute('charset','iso-8859-1raSingleQuote);s.setAttribute('src',src);document.getElementsByTagName('head').item(0).appendChild(s);}if(window.attachEvent)window.attachEvent('onload',lpAddMonitorTag);else window.addEventListener("load",lpAddMonitorTag,false);
//]]>
</script>
<!--END LivePerson Monitor.-->




Keywords: button code monitor tag XHTML strict standards