Home > front end >  Array print is empty, check it again and data, print the array length is zero, don't know how t
Array print is empty, check it again and data, print the array length is zero, don't know how t

Time:11-27


Want to see, understand the elder teach me

CodePudding user response:

Request the json data is not support synchronously,
Setting the async: false invalid
So the only way to switch to an asynchronous callback function returns a value,

CodePudding user response:

The json and ajax requests or distinguishing
The ajax request is XMLHttpRequest
Json is adding a script tag, async: false Settings take effect, can't sync,
In the logic inside the success of the json

CodePudding user response:

I will not sad??????
  • Related