# Javascript doesn´t work

**URL:** <https://community.thunkable.com/t/javascript-doesn-t-work/57307>\
**Category:** Questions about Thunkable X\
**Created:** [November 20, 2018, 6:19pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307 "2018-11-20T18:19:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nico\_Marikucza](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nico_marikucza/32/15365_2.png) [@Nico\_Marikucza](https://community.thunkable.com/u/Nico_Marikucza)\
**Post date:** [November 20, 2018, 6:19pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/1 "2018-11-20T18:19:19Z")

</div>

Hello all,

I wanted to know if Javascript works in the WebViewer of the Thunkable X Platform. It doesn´t look like it works because I get the error 101 when trying to use javascript.  
I wanted to use Taifun´s Tutorial how to inject text into the website and click a button using Javascript because it is, as far as I know, the only option to encrypt/decrypt text with AES in the Thunkable X Platform.

I use these blocks:

 ![AES](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/d/dd8ed27f7b451f937602b37e54657f853fbf7c47.jpeg)

Thank you for your help  
Nico

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [November 20, 2018, 6:35pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/2 "2018-11-20T18:35:39Z")

</div>

Hi,

use data URI.

![javascript](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/8/08877d523c0ceefeeae76b75463e932935432ccf.png)

---

<div class="post-metadata">

**Author:** ![ptptmailj9epqr](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@ptptmailj9epqr](https://community.thunkable.com/u/ptptmailj9epqr)\
**Post date:** [April 19, 2020, 12:23pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/3 "2020-04-19T12:23:55Z")

</div>

I tried this approach but I’m not quite sure if I did something wrong or if this doesn’t work in thunkable X.

Here’s a link to the project, if you can help. I need to run JS in Thunkable to include a JS UUID generator:  
[https://x.thunkable.com/projects/5e9c380d1993a119fb61a172/a6f96313-07b0-4b6a-a70b-8421c5cb8443/designer](https://x.thunkable.com/projects/5e9c380d1993a119fb61a172/a6f96313-07b0-4b6a-a70b-8421c5cb8443/designer)

---

<div class="post-metadata">

**Author:** ![ptptmailj9epqr](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@ptptmailj9epqr](https://community.thunkable.com/u/ptptmailj9epqr)\
**Post date:** [April 19, 2020, 12:27pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/4 "2020-04-19T12:27:51Z")

</div>

ahhh…I did a typo. works fine if typed correctly. Thanks!

---

<div class="post-metadata">

**Author:** ![ptptmailj9epqr](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@ptptmailj9epqr](https://community.thunkable.com/u/ptptmailj9epqr)\
**Post date:** [April 19, 2020, 1:10pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/5 "2020-04-19T13:10:39Z")

</div>

At the same designer link, I’m trying to update your sample code to produce a new uuid on button click.

I don’t know if I’m making a typo or have a misunderstanding of nested JS functions and variable declaration/scope …or both.

Your help is appreciated!

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 19, 2020, 2:08pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/6 "2020-04-19T14:08:08Z")

</div>

Here are 3 working examples of the app interacting with JavaScript. The js file could be hosted locally I believe and the concept still work.

> **[GitHub - thunkable/webviewer-extension: Communicate between the Thunkable Web...](https://github.com/thunkable/webviewer-extension)**
>
> Communicate between the Thunkable Web Viewer and a website - GitHub - thunkable/webviewer-extension: Communicate between the Thunkable Web Viewer and a website

An expanded example of above

> **[jaredgibb.xyz](http://jaredgibb.xyz/thunkable/chartingwiththunkable/)**
>
> This domain may be for sale!

---

<div class="post-metadata">

**Author:** ![tonyz80](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tonyz80/32/67985_2.png) [@tonyz80](https://community.thunkable.com/u/tonyz80)\
**Post date:** [April 22, 2021, 8:03pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/7 "2021-04-22T20:03:25Z")

</div>

Hello

Is there a way to generate an Object ID (similar to UUID) from within x.Thunkable for use with a POST API call to a MongoDB (\_id)?  
I know that if the \_id is NOT present, Mongo creates one for me, but I need this \_id to continue with a PUT statement.

Any help would be appreciated.  
thanks

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [April 22, 2021, 8:27pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/8 "2021-04-22T20:27:15Z")

</div>

Create a local table using the Data Sources option and whenever you need a UUID just create a row in the local table and get the UUID from it.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 23, 2021, 12:31pm UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/9 "2021-04-23T12:31:30Z")

</div>

You should already have the ID if you are making a PUT call., else, you wouldn’t know what you were PUTing.  
Right?

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:38am UTC](https://community.thunkable.com/t/javascript-doesn-t-work/57307/10 "2024-11-08T11:38:51Z")

</div>


