<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[ANSWERED] JavaScript Actor - What JavaScript is supported inside the Actor?]]></title><description><![CDATA[<p>I'm currently trying to use a JavaScript Actor to pull in some data from an API, but I'm having some issues. I'm getting these errors that the functions Im trying to use are not defined. These are built-in JavaScript functions. For example: date().</p>
<p>Any help would be greatly appreciated.</p>]]></description><link>https://community.troikatronix.com/topic/7456/answered-javascript-actor-what-javascript-is-supported-inside-the-actor</link><generator>RSS for Node</generator><lastBuildDate>Thu, 21 May 2026 13:21:04 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/7456.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Jul 2021 19:48:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [ANSWERED] JavaScript Actor - What JavaScript is supported inside the Actor? on Fri, 16 Jul 2021 15:45:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/124">@dusx</a> This is amazing and super helpful. Thanks!</p>]]></description><link>https://community.troikatronix.com/post/46448</link><guid isPermaLink="true">https://community.troikatronix.com/post/46448</guid><dc:creator><![CDATA[bslaght]]></dc:creator><pubDate>Fri, 16 Jul 2021 15:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] JavaScript Actor - What JavaScript is supported inside the Actor? on Wed, 14 Jul 2021 15:24:06 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/4525">@bslaght</a></p><p>The Javascript engine in the Javascript actor is the google V8 engine. It has all core ecmascript functions, but does not contain any of the DOM related features (these are part of the browser).</p><p>see: <a href="https://hackernoon.com/javascript-v8-engine-explained-3f940148d4ef">https://hackernoon.com/javascr...</a></p><p>You can use the Get URL Text actor to retrieve a websites text (or data from a REST api) and pass this into javascript for parsing.<br />Or you can use TCP IP actors to interact directly with the server. see: <a href="https://www.dusxproductions.com/blog/using-data-from-web-apis-in-isadora-part-1">https://www.dusxproductions.co...</a></p><p>You will want to use print(); rather than console.log(); to output message to the Monitor window (the .log is part of the browser as well)</p><p>These articles will be helpful I think:<br /><br /><a href="https://support.troikatronix.com/support/solutions/articles/13000014933-getting-started-with-javascript">https://support.troikatronix.c...</a><br /><a href="https://support.troikatronix.com/support/solutions/articles/13000014934-how-to-load-external-data-with-javascript">https://support.troikatronix.c...</a></p><p>The second one introduces a couple Isadora specific functions for loading external data (or including Libraries.. NOTE libs must be pure Javascript, no DOM etc. Many for Node.JS will work)</p>]]></description><link>https://community.troikatronix.com/post/46438</link><guid isPermaLink="true">https://community.troikatronix.com/post/46438</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Wed, 14 Jul 2021 15:24:06 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] JavaScript Actor - What JavaScript is supported inside the Actor? on Tue, 13 Jul 2021 20:12:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/2066">@juriaan</a> said:</p>
<blockquote>Date.now()</blockquote>
<p> Thanks for the quick reply. This is just one example of something I was trying. My goal is to hit a URL with some additional headers and get back some json. Not reflected here, but what I'm working toward.</p><p>function main()<br />{</p>
<p>return fetch('http://api.plos.org/search?q=title:DNA')<br />.then(response =&gt;{<br />    return response.json();<br />}).then(data =&gt;{<br />    console.log(data);<br />})</p>
<p>}</p>]]></description><link>https://community.troikatronix.com/post/46434</link><guid isPermaLink="true">https://community.troikatronix.com/post/46434</guid><dc:creator><![CDATA[bslaght]]></dc:creator><pubDate>Tue, 13 Jul 2021 20:12:34 GMT</pubDate></item><item><title><![CDATA[Reply to [ANSWERED] JavaScript Actor - What JavaScript is supported inside the Actor? on Tue, 13 Jul 2021 19:55:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/4525">@bslaght</a></p><p>Hi there!</p><p>Welcome to the Isadora community forum. Happy to help.</p><p>When I try to use Date.now() for example it returns the correct result. Could you share some code with us?</p><p>Thanks!</p>]]></description><link>https://community.troikatronix.com/post/46433</link><guid isPermaLink="true">https://community.troikatronix.com/post/46433</guid><dc:creator><![CDATA[Juriaan]]></dc:creator><pubDate>Tue, 13 Jul 2021 19:55:01 GMT</pubDate></item></channel></rss>