Skip to main content
amangoyal15
Level 3
Nov 29, 2016 7:39 PM UTC
Solved

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

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.
Peter_Puzanovs
Peter_PuzanovsAccepted solution
Community Advisor
Nov 29, 2016 11:27 PM UTC

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
Nov 29, 2016 11:27 PM UTC

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

Translate