Expand my Community achievements bar.

SOLVED

How to use JS method's return value in <div data-sly-test>

Avatar

Level 2

HI,

 I have a JS function returning some value. And I have to use this value in <div data-sly-test> condition.

How can this be done?

Regrads,

Prateek

1 Accepted Solution

Avatar

Correct answer by
Employee

You would use that via the data-sly-use api

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

You would use that via the data-sly-use api

Avatar

Level 3

Hi,

I am facing similar issues. I tried to use the Javascript Use API, but that is causing a few problems of its own. I created a separate JS file and called it in my HTML using the  <data-sly-use>. So I am able to use the JS variables in my HTML, but it gives me error whenever I use JS functions such as 'alert()' or even on jquery calls. The workaround I got was to implement the JS within <script> tags of my component's HTML.

Is there any way of integrating the two?

My question can be accessed from here :

http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...