默认的情况下$.getJSON 是异步的操作。一些情况下 我们需要它是同步 只要在执行之前写入代码:

 $.ajaxSettings.async = false;

执行完毕后 再执行: $.ajaxSettings.async = true; 回复为异步即可