Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2019-02-23 10:24:19

mhaziq
Member
Registered: 2018-03-20
Posts: 1

Chat Widget not display when online in ReactJS

I have develop simple ReactJS app. It work fine when chat widget status is offline but disappear when online. In my Console it say that LHCCHatOptions is not defined.
1550917422_lh1.jpg
This is my code:-

[== Undefined ==]
import React, { Component } from "react";
 
class Stuff extends Component {

  render() {
    var LHCChatOptions = {};

LHCChatOptions.opt = {widget_height:340,widget_width:300,popup_height:520,popup_width:500};

(function() {
  //var LHCChatOptions = {};
  //LHCChatOptions.opt = {widget_height:340,widget_width:300,popup_height:520,popup_width:500};
  var po = document.createElement('script'); 
  po.type = 'text/javascript'; 
  po.async = false;
  var referrer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf('://')+1)) : '';
  var location  = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : '';
  po.src = '//localhost/livechat/lhc_web/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(ma)/br/(top)/350/(units)/pixels/(leaveamessage)/true/(theme)/1/(survey)/1?r='+referrer+'&l='+location;
  var s = document.getElementsByTagName('script')[0]; 
  s.parentNode.insertBefore(po, s);
})();

    return (
      <div>
        <h2>STUFF</h2>
        <p>Mauris sem velit, vehicula eget sodales vitae,
        rhoncus eget sapien:</p>
        <ol>
          <li>Nulla pulvinar diam</li>
          <li>Facilisis bibendum</li>
          <li>Vestibulum vulputate</li>
          <li>Eget erat</li>
          <li>Id porttitor</li>
        </ol>
      </div>
    );
  }
}
 
export default Stuff;

Offline

#2 2019-02-23 10:38:23

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: Chat Widget not display when online in ReactJS

Hi mhaziq,
thank you for your question.

I am sorry to inform this seems to be out of the free limited support i can give.
You can find more info on my forum signature.


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

Board footer