How to Open the Instant Chat interface in a New Browser Window
Articles related to customization are written for a technical audience who have experience in web development. Knowledge of HTML, CSS, and JavaScript are required.
To open Instant Chat in a new browser window, customize the following code and insert it into your environment.
sample1.html is a form that opens the Instant Chat interface, as defined in sample2.html.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<table>
<tr><td>Name: </td><td><input id="Name" type="text" maxlength="64" /></td></tr>
<tr><td>Email: </td><td><input id="Email" type="text" maxlength="512" /></td></tr>
</table>
<input type="button" value="OpenChatInANewWindow" onclick="window.open('sample2.html
?Name=' + document.getElementById('Name').value + '&Email=' + document.getElementById
('Name').value, '', 'toolbar=no, status=no, menubar=no, titlebar=no, location=no,
scrollbars=no, resizable=no, height=500, width=400');" />
</body>
</html>
sample1.html
sample2.html is the Instant Chat interface.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript"
src="https://secure.logmeinrescue.com/InstantChat/InstantChat.aspx"></script>
<script type="text/javascript">
function getParameter(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if (results == null)
return "";
else
return results[1];
}
function loadInstantChat()
{
var ICLoader = new RescueInstantChatLoader();
ICLoader.ICContainer = "ICContainer";
ICLoader.HostedCSS = "http://[YourSite]/yourstylesheet.css";
ICLoader.HostedLanguagesForChatOnlyMode = "http://[YourSite]/
LanguagesForChatOnlyMode.js";
ICLoader.HostedLanguagesForAppletMode = "http://[YourSite]/LanguagesForAppletMode.js";
ICLoader.EntryID = "123456789";
ICLoader.Name = getParameter("Name");
ICLoader.Comment1 = getParameter("Email");
ICLoader.Start();
}
</script>
</head>
<body onload="loadInstantChat();">
<div id="ICContainer" style="position: absolute; left: 0px; top: 0px; width: 400px;
height: 500px"></div>
</body>
</html>
sample2.html
Article last updated: 27 September, 2022