jQuery: wait for function to complete to continue processing?

后端 未结 9 1126
轮回少年
轮回少年 2020-12-06 00:28

Hey all. I have, what appears to be, a trivial problem. I have the following JavaScript:

$(function() {
    var r = GetResults();

    for(var i = 0; i <         


        
9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 01:12

    This is not possible.

    Either you make your function synchronous or you change the design of your code to support the asynchronous operation.

提交回复
热议问题