Skip to main content
1-Visitor
Mar 1, 2021 10:31 AM UTC
Question

JQuery in mashup function (ThingWorx 9.1)

Does ThingWorx 9.1 allow using JQuery in expressions?

5 replies

16-Pearl
Mar 2, 2021 5:15 AM UTC

I did a small test and validated that JQuery works in expression function in 9.1. Import the attached entity and view the mashup, on button click the expression function changes the URL. 

Translate
1-Visitor
Mar 2, 2021 9:34 AM UTC

Thank you for your response. I tried to find definite answer somewhere in the documentation but I wasn't able to. I've tested your example and yes, it works fine.

 

My other question as a follow up is, can you use other functions such as selectors and css()? I this is my main goal with JQuery, and I was testing your example with simple background change:

 

 

$('#root_flexcontainer-2').css('background', 'rgb(0,0,0)');

 

 

In devtool it work, but when placed inside an expression it does not seem to do anything.

Translate
16-Pearl
Mar 3, 2021 8:01 AM UTC

I am not sure what all functions we can use. I tried using 

$('#root_flexcontainer-2').css('background', 'rgb(0,0,0)');

but I was unable to make it work. If I find a way, I will update it here.

Translate