• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How to make ajax or axios call in jsx cep

Contributor ,
Jul 20, 2020 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

418

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
community guidelines
Adobe
Contributor ,
Jul 20, 2020 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.

Votes

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
community guidelines
Community Expert ,
Jul 20, 2020 Jul 20, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines