Ajax call to USE-API script | Community
Skip to main content
Level 2
Jul 16, 2021 3:09 PM UTC
Solved

Ajax call to USE-API script

I have an RTE in my dialog with a link plugin, that would update some values data-foo & data-bar and store them along as part of the anchor tag in a property on save. data-foo and data-bar are completely dependent upon the href value mentioned by user in the link dialog. To generate both the values, I have a logic built using a use-api script that has access to the ResourceResolver and Externalizer classes. Is it possible for us to send an ajax call or any other request to the server with the href value as argument from the dialog.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Jul 17, 2021 1:43 PM UTC

5 replies

shelly-goel
Employee
Jul 18, 2021 12:13 PM UTC

@premib  Did you try to make this ajax call from the same use-api script where you're creating data-foo & data-bar? That should have the href value already.

Translate
PremIBAuthor
Level 2
Jul 19, 2021 3:49 AM UTC
@shelly-goel I do not understand why I should be making a call from the use-api script again to the same script. My intention here is to call the backend script from frontend javascript. is it possible?
Translate
arunpatidar
arunpatidarAccepted solution
New Participant
Jul 17, 2021 1:43 PM UTC
PremIBAuthor
Level 2
Jul 19, 2021 1:03 PM UTC
@arunpatidar but the use api script i've mentioned in is a javascript use api script. It also accepts some values as arguments. is it possible to execute this javascript use api script from a servlet then?
Translate