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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 7 years and 4 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
gerald.jedlicka@arjohuntleigh.com
Posts: 2
Last visit: Mon Feb 15, 2021 5:49 am

Javascript - object expected

Post 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 4190 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
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Javascript - object expected

Post 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.
DevinL
SAPIEN Technologies, Inc.
User avatar
gerald.jedlicka@arjohuntleigh.com
Posts: 2
Last visit: Mon Feb 15, 2021 5:49 am

Re: Javascript - object expected

Post 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!!!
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Javascript - object expected

Post 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.
DevinL
SAPIEN Technologies, Inc.
This topic is 7 years and 4 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.