且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery Ajax响应和变量分配问题

更新时间:2022-06-05 09:10:27

最有可能是在返回ajax调用之前读取了用户变量的问题,因此它始终是未定义的,请尝试将if语句放在ajax调用中并以这种方式进行测试.

It's most likely a problem with the user variable being read before the ajax call is returned so it will always be undefined, try placing your if statement inside the ajax call and test it that way.