Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

amangoyal15
Level 3
Level 3

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.

1 Accepted Solution
Peter_Puzanovs
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post

1 Reply
Peter_Puzanovs
Correct answer by
Community Advisor
Community Advisor

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

View solution in original post