Forum Discussion
Hi Inactive User ,
Yes, this should work in the endpoints., i.e. you can call a custom endpoint on link click, or you can also look to create a complete ajax call with jquery(convert the curl command to javascript code) if you are not comfortable with Freemarker. But the use of the freemarker object is good as it will not expose the API and Data.
Documentation to use Jquery in the community
https://developer.khoros.com/khoroscommunitydevdocs/reference/liaaddscript
Please Give Kudos if you find this post useful and also mark this as Accepted Solution if this is the required solution.
Regards
Tarun Kumar
Tarun, can you give me an example of the API call in JQuery?
- Tarun5 years agoMaven
Hi Inactive User ,
you can try the following code in a component:
<@liaAddScript>
;(function($){
$.ajax({
type: "Get",
url: "/api/2.0/search?q=SELECT * FROM users",
success: function(data) {
console.log(data)
},
});
})(LITHIUM.jQuery);
</@liaAddScript>Please Give Kudos if you find this post useful and also mark this as Accepted Solution if this is the required solution.
Regards
Tarun Kumar
- Inactive User5 years ago
Thanks, Tarun however, where would the label call go in that AJAX call? In the success part? What would the call look like? Sorry, Khoros makes this really difficult!