Skip to main content
Inspiring
July 20, 2020
Question

How to make ajax or axios call in jsx cep

  • July 20, 2020
  • 2 replies
  • 650 views

I'm currently working in CEP panel and I have a JSX file.

I'm wondering is there away I can make an ajax call or axios cal from with in this jsx?

If so how would I import jquery into it for the ajax call or require the axios module?  Is that even possible?

This topic has been closed for replies.

2 replies

Community Expert
July 21, 2020

You guessed it right that it won't be possible out of the box on the jsx side. Some points with noting are

  • Jsx is meant to work on the native app DOM like Illustrator, InDesign etc. So it does not come with support for webapi's like ajax
  • Jsx is based on a very old standard of ECMA script, so many language features are also missing so intergrating a new library into it is a chore in itself.

So as you rightly guessed the recommended way would be making these calls on the js side and then so it to jsx side

 

-Manan

-Manan
OhmsGAuthor
Inspiring
July 20, 2020

After digging into this I guess it's not possible.  The way I'm seeing to do it is to run it on the js side and then pass any corresponding data to the JSX as a json object.