Rich-text Reply

Multiple external js files and ajax calls

ecmsupport 06-27-16

Multiple external js files and ajax calls

We have an experiment designed for our website. To complete the experiment, we want to run a script that has ajax call in it. This script also depends on external scripts. The scripts have javascript plugins to render and parse the data, and the ajax call loads the actual data from the website. I have tried loading the scripts in callback for one another. For ex: Say the external scripts are: ES1,ES2 . I was able to loads them as

Load(es1)

{callback{Load(es2 } . This seems to work.

 

But when I try to call ajax in the call back for es2 as

Load(es1)

{callback{

Load(es2)

{callback { ajax call { callback { Get the data, parse and render it- The actual logic}

}

}

 

The ajax call fails.

 

What is the recommended way to handle such as situation?