how to evaluate JSON file in JS file not in dialog listener JS? | Community
Skip to main content
amangoyal15
Level 3
November 29, 2016
Solved

how to evaluate JSON file in JS file not in dialog listener JS?

  • November 29, 2016
  • 1 reply
  • 876 views

I need to evaluate JSON file kept on some path in JS file.

path = "/apps/ademo/components/structure/basepage/mapp.json";

Like in dialog listener JS , we do -    var x = CQ.shared.HTTP.eval(path);

I want to evaluate in component specific JS file.

(When i use  "CQ.shared.HTTP.eval(path)" in component specific JS file, it gives an error as )

Please assist.

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 Peter_Puzanovs

Define clientlib(javascript file) which would define a function(javascript is all about functions) which would do the instructions you require to execute.

Run you function both in Author mode and Publisher mode.

Make sure you include your clientlib in both modes is added to your html.

Regards,

Peter

1 reply

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
November 29, 2016

Define clientlib(javascript file) which would define a function(javascript is all about functions) which would do the instructions you require to execute.

Run you function both in Author mode and Publisher mode.

Make sure you include your clientlib in both modes is added to your html.

Regards,

Peter