Javascript Function With JQuery POST Always Returns undefined

后端 未结 5 1657
情书的邮戳
情书的邮戳 2020-12-20 02:35

I have no idea what\'s going on here and was hoping someone could help, I\'m sure it\'s something easy going on that I\'m just missing.

I have a function in javascri

5条回答
  •  Happy的楠姐
    2020-12-20 03:28

    The problem is that you are returning i outside of the callback function. Basically when you return i, its contents don't exist yet, and won't exist until the server returns the data to your callback function.

提交回复
热议问题