Multiple ajax calls at same time

后端 未结 2 2094
失恋的感觉
失恋的感觉 2020-11-30 00:54

I have developed some websites and I always stumble a the same point: multiple ajax calls. I have a main page where all the content is loaded asynchronously. When the page i

2条回答
  •  情书的邮戳
    2020-11-30 01:25

    Make sure you have different callbacks for each ajax call, it sounds like you are trying to use the same function for all four, thus when they are called out of order (because they take different amounts of time server-side), they are rendering in the wrong place. If you insist on using the same function for all your callbacks, then you have to put something in the payload so that the callback knows where to render to.

提交回复
热议问题