Jump to content
Sign in to follow this  

Please Help... How To Call Javascript From Box

Recommended Posts

Okay, so we have multiple sites that use a live chat feature. The feature works by incorporating javascript into the page at some defined place and adding the "online" or "offline" image - depending on which is which.


Well, I thought incorporating this into a box would be easy, just change the text area to the script - but no such luck.


Does anyone have any suggestions on what I need to do to make this work?


Here's the box text that I thought would work, but instead halts my site.


?$Id: reviews.php,v 1.37 2003/06/09 22:20:28 hpdl Exp $

?osCommerce, Open Source E-Commerce Solutions

?Copyright (c) 2003 osCommerce

?Released under the GNU General Public License
<!-- warrantyregistration //-->
? ? ? ? ?<tr>
? ? ? ? ? ?<td>
?$info_box_contents = array();
?$info_box_contents[] = array('text' => 'Chat Live');

?new infoBoxHeading($info_box_contents, false, false);

?$info_box_contents = array();
?$info_box_contents[] = array('text' => '<!-- BEGIN PHP Live! code, (c) OSI Codes Inc. -->
<script language="JavaScript" src="http://www.mysite.com/phplive/js/status_image.php?base_url=http://www.mysite.com/phplive&l=mysitename&x=1&deptid=0&btn=1"><a href="http://www.phplivesupport.com"></a></script>
<!-- END PHP Live! code : (c) OSI Codes Inc. --><br>');

?new infoBox($info_box_contents);


And here is the code I inserted into the sts_user_code as instructed:


// Live Chat Box
$sts_block_name = 'livechat';
require(DIR_WS_BOXES . 'livchat.php');
$template['livechat'] = strip_unwanted_tags($sts_block['livechat'], 'livechat');


Thank you.



Edited by aresman

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this