We have component that makes jquery ajax call to load some json. This component is used in a teaser page. When I hit the teaser with teaser.html the ajax call happens and the json is rendered. But when this teaser is resolved via segmentation and when this loads the page then this ajax call does not happen. The rendered html has the <script> element where ajax call needs to happen.
Any ideas?
Regards
Rama.
Solved! Go to Solution.
Views
Replies
Total Likes
Sham, thanks for your quick attention. It turned out that we have to use CQ.shared.HTTP.get(url, function() {}); rather than juery.Ajax. The issue was to execute an another ajax call on a teaser load while the teaser itself was loaded via ajax. so the 2nd ajax call was not happening because after first ajax call to load the teaser the script tags on the teaser page were treated like txt rather than executable java script. But some how this went away if I use CQ get api rather than jquery ajax api.
Regards
Rama.
Views
Replies
Total Likes
Most of the time the root cause seems to be with some custom javascript the way it gets loaded. Is the url of page publicly accessible?
Views
Replies
Total Likes
Sham, thanks for your quick attention. It turned out that we have to use CQ.shared.HTTP.get(url, function() {}); rather than juery.Ajax. The issue was to execute an another ajax call on a teaser load while the teaser itself was loaded via ajax. so the 2nd ajax call was not happening because after first ajax call to load the teaser the script tags on the teaser page were treated like txt rather than executable java script. But some how this went away if I use CQ get api rather than jquery ajax api.
Regards
Rama.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies