Javascript - object expected

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
gerald.jedlicka@arjohuntleigh.com
Posts: 2
Joined: Thu Dec 03, 2015 3:29 am

Javascript - object expected

Post by gerald.jedlicka@arjohuntleigh.com » Mon Feb 27, 2017 11:36 am

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 2666 times
I have the same behavior on 3 different machines and NO idea what is wrong

Thanks in advance for your help
BR
Gerald

DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Javascript - object expected

Post by DevinL » Mon Feb 27, 2017 12:11 pm

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.
DevinL
SAPIEN Technologies, Inc.

User avatar
gerald.jedlicka@arjohuntleigh.com
Posts: 2
Joined: Thu Dec 03, 2015 3:29 am

Re: Javascript - object expected

Post by gerald.jedlicka@arjohuntleigh.com » Tue Feb 28, 2017 2:54 am

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!!!

DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Javascript - object expected

Post by DevinL » Tue Feb 28, 2017 9:25 am

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.
DevinL
SAPIEN Technologies, Inc.