Highlighted

How to make ajax or axios call in jsx cep

Participant ,
Jul 20, 2020

Copy link to clipboard

Copied

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?

Topics

Scripting

Views

54

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to make ajax or axios call in jsx cep

Participant ,
Jul 20, 2020

Copy link to clipboard

Copied

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?

Topics

Scripting

Views

55

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 20, 2020 1
Participant ,
Jul 20, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 20, 2020 0
Adobe Community Professional ,
Jul 20, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 20, 2020 0