2014年4月7日 星期一

JQuery $.ajax access variables outside the function

Probably because Validate.fail(test) occurs immediately after the asynchronous call. Remember it is ASYNCHRONOUS, meaning it executes parallel to javascript running on your page.

use async: false in $.ajax request




References :
javascript - Use variable outside the success function from an ajax/jquery call - Stack Overflow

沒有留言:

張貼留言