'Type error: console is not a function'

Hey everyone,

So this is really weird, not only because console is a function and should work, but also because it works pefectly for me on my PC and the users of my WebSite are getting that error. I think not all of them.

Here’s the line of code when I use the console function:

console.log("log");

Please can someone help me?

Where does this error occur? Where are you using console?

It’s inside a $w.OnReady event.

Please show the code. You can also post the URL to your site.

BTW - it should be onReady() and not OnReady().

The code inside the $w.onReady event works fine for me, for others only the console.log won’t work. Here’s the the link to my website: https://pptgamespt.wixsite.com/crate
And btw, tell me if you get the error.

Hello.
I think somewhere in your code you have console(‘test’) not console.log(‘test’). Because error is console is not a function. Not console.log.

Oh, I didn’t see that. I really have console(‘…’). Thank you so much!

Oh and BTW: could you PLEASE help me out with the following code? It’s in the same event.
It should show the $w(“#loggedbox”) if $w(“#log”) text is not empty. If it’s empty then it should show $w(“#notloggedbox”).
But when it’s not empty it shows both but it only outputs the console.log(“logged: " + $w(”#log").text).
That is so weird, please can you help me?

if ($w("#log").text !== "") {
        console.log("logged: " + $w("#log").text);
        $w("#notloggedbox").hide();
        $w("#loggedbox").show();
        $w("#loadingacc").hide();

        // ...

    } else if ($w("#log").text === "") {
        console.log("not logged: " + $w("#log").text);
        $w("#notloggedbox").show();
        $w("#loggedbox").hide();
        $w("#loadingacc").hide();
    }

Hi,
Can you please open a new thread for your new question?

Thanks,

Liran.