Page 1 of 1

Javascript - object expected

Posted: Mon Feb 27, 2017 11:36 am
by gerald.jedlicka@arjohuntleigh.com
PrimalScript 2017, Version 7.3.99
32 or 64 bit version of product: 64bit
Operating system: Windows
32 or 64 bit OS: 64bit

Hi
I installed PrimalScript 2017, Version 7.3.99 because I have to run now a Java-Project.
Even the simplest script is not working

Here is the script:
alert(1);

I always receive the same error: Runtimerror in Microsoft JScript: Object expected (see attached german screenshot)
27-02-_2017_19-31-31.png
27-02-_2017_19-31-31.png (27.43 KiB) Viewed 2708 times
I have the same behavior on 3 different machines and NO idea what is wrong

Thanks in advance for your help
BR
Gerald

Re: Javascript - object expected

Posted: Mon Feb 27, 2017 12:11 pm
by DevinL
This is because alert isn't actually a part of Javascript, but rather a part of the browsers that run the script. Try using WScript.echo instead of alert.

Aside from this, the rest should remain the same. If you wish to use a separate host, you can install Node.js and configure PrimalScript to use the Node executable to run javascript instead.

Re: Javascript - object expected

Posted: Tue Feb 28, 2017 2:54 am
by gerald.jedlicka@arjohuntleigh.com
DevinL wrote:This is because alert isn't actually a part of Javascript, but rather a part of the browsers that run the script. Try using WScript.echo instead of alert.

Aside from this, the rest should remain the same. If you wish to use a separate host, you can install Node.js and configure PrimalScript to use the Node executable to run javascript instead.
OMG, sometimes you are even unable to see the wood for the trees. Grrrr, I dont know how often I used the wscript.echo instead of ... how ever ... :lol: :lol: :lol: THANKS A LOT!!!

Re: Javascript - object expected

Posted: Tue Feb 28, 2017 9:25 am
by DevinL
Haha, no problem at all! It took a bit of Google-fu for me to remember that as well ;)

If you have any further issues, please don't hesitate to post again.