javascript - strategy to split up php output into smaller outputs (ajax, php) (nested ajax calls, ajax within ajax?) -


I do not know the correct terminology for the solution, please try to break PP output in smaller parts and read them the feedback of AJAX Suggest a strategy to remove the step by step.

This project is an AJAX webpage that takes the text string (last name) and sends it to a PHP program, PHP code takes the last name and randomly receives people with 3 different names. , And puts it in an array Once this is done, the php code will contact the external server to obtain information related to each name, and the information will output on a single page of the webpage. Process to obtain data from external servers is very slow.

This code is basically done, but the whole process takes a very long time to produce output on the screen.

My phonetic php code is like this:

 

Code> & lt;? Get 3 names; // Get instant alias name (get phone number)? & Gt;

Alternatively, I could get a name and phone #, and it was quick to output it before going to the next name.

What are the php or AJAX code / functions / strategies that will get it? Please suggest suggestions or search keywords.

Add / edit:

Thanks for the suggestions. Is it possible to call another AJAX call after Ajax call? I went to that route initially, but my test of Nested JS / AJAX calls was not working. This syntax may be due to errors, please see the code.

Test code in testajax.php (or testajax.html) file for Ajax Call XHR.responseText

   

If I look directly at the testajax.php (or testajax.html) file, then I'll see

  JAM text holder & gt; & Gt; (A warning window) Attach Text & gt; & Gt; Ending the doclite text  

But if I call an Ajax testajax.php file, then I see

  JAM text holder & gt; & Gt; End of text  

& lt; Script & gt;

TIA

Can anyone explain this, and

< Div class = "post-text" itemprop = "text">

It's hard to know the actual code and code-based answers but here's an idea.

When you get three names, return them to the page and display them. Then, for each one, call a phone call in a different AJAX call, I'm not positive if Javascript frees three calls independently of each other, but it will display at least 3 names, and then each Phone information will be at one time.

Editing

Workflow:

  • Javascript sends names to a php via AJX.
  • JS
  • Adds 3 devices to JS page, one with each name.
  • JS3 requests requests, send 1 name to each request.
  • php
  • JS takes information and adds it to the corresponding device

Comments