Javascript Variables

Das Goravani goravanis at gmail.com
Sun Nov 20 17:00:28 UTC 2022


Hello,

I am doing some very simple Javascript. I am reading and writing cookies from the browser in Omnis. 

The read part goes OK, and uses an Omnis variable in the Javascript

Let myVar = document.cookie

myVar is an Omnis variable and it works inside the one line of Javascript.

But on writing, I am having a problem. 

Document.cookie=myVar

It gives an error saying the $class is missing. I know it sounds like Omnis. 

I am thinking of trying

Document.cookie=var myVar

Putting var in front.. I saw that in someone’s JS code. Gonna try it.

Does anyone know why a Var would work in one place yet not another?

Any help appreciated. 

Das Goravani


More information about the omnisdev-en mailing list