How to use JS method's return value in <div data-sly-test> | Community
Skip to main content
Prateek_Agrawal
Level 2
October 16, 2015
Solved

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

  • October 16, 2015
  • 2 replies
  • 1470 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

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

2 replies

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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

Har_Khandelwal
Level 2
October 16, 2015

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-manager.topic.html/forum__jssm-hi_i_am_tryingt.html