# Code elements not defined online

**URL:** <https://discourse.psychopy.org/t/code-elements-not-defined-online/14977>\
**Category:** Online experiments\
**Created:** [July 10, 2020, 2:27pm UTC](https://discourse.psychopy.org/t/code-elements-not-defined-online/14977 "2020-07-10T14:27:23Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lpxhs5](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@lpxhs5](https://discourse.psychopy.org/u/lpxhs5)\
**Post date:** [July 10, 2020, 2:43pm UTC](https://discourse.psychopy.org/t/code-elements-not-defined-online/14977/2 "2020-07-10T14:43:50Z")

</div>

Hi!

I think the section on custom colours on page 3 of wakecarter’s crib sheet will help here!

> [@PsychoPy Python to Javascript crib sheet](https://discourse.psychopy.org/t/psychopy-python-to-javascript-crib-sheet/14601):
>
> Many people come to this forum because their experiment works fine locally but doesn’t work online. The reason is that the Python code needs to be translated to Javascript and the auto translate that was added to PsychoPy in January 2020 primarily translates the grammar rather than the individual functions. If you want to run PsychoPy online I highly recommend that you: Write your experiment in Builder using version 2023.1.3 (or later). Study my crib sheet to familiarise yourself with the…

I think you might need to add…

```auto
red = new util.Color([1, 0, 0]);

```

…to the begin experiment tab on the JS script side.

I hope that helps 🙂

---

_[View the full topic](https://discourse.psychopy.org/t/code-elements-not-defined-online/14977)._
