FreiChat related discussions
Uncaught ReferenceError: freichatusers is not defined

Dear Codologic,

when I use the following code:

<script>FreiChat.freichatopt("goOnline");</script>  

I receive the error:

"Uncaught ReferenceError: freichatusers is not defined"

Clicking (f12, console) on the source file shows:

FreiChat.freichatopt = function(opt)
{
var users_length = freichatusers.length;

if (FreiChat.ses_status == null)
{
    FreiChat.freistatus = 1;  

I use the code after I load Freichat. And Freichat works fine.

Any ideas? I am trying to get the users to receive the status 'Available', after logging in.

Greets

Dear Codologic, when I use the following code: &amp;lt;script&amp;gt;FreiChat.freichatopt(&quot;goOnline&quot;);&amp;lt;/script&amp;gt; I receive the error: &quot;Uncaught ReferenceError: freichatusers is not defined&quot; Clicking (f12, console) on the source file shows: FreiChat.freichatopt = function(opt) { var users_length = freichatusers.length; if (FreiChat.ses_status == null) { FreiChat.freistatus = 1; I use the code after I load Freichat. And Freichat works fine. Any ideas? I am trying to get the users to receive the status &#039;Available&#039;, after logging in. Greets

Make sure you are running your code inside document ready event .

Do you get the same error, if you manually run the code in the console in developer tools(f12 chrome) ?

Make sure you are running your code inside ```document``` ready event . Do you get the same error, if you manually run the code in the console in developer tools(f12 chrome) ?

If I run the code in the console, it works fine, without an error. How would the code look like for it to work?

If I run the code in the console, it works fine, without an error. How would the code look like for it to work?

You can try running below after FreiChat:

jQuery( window ).load(function() {
 FreiChat.freichatopt("goOnline");
});
You can try running below after FreiChat: ``` jQuery( window ).load(function() { FreiChat.freichatopt(&quot;goOnline&quot;); }); ```
214
4
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft