Jquery $.getJSON()设置同步
如下:
$.ajaxSettings.async = false; $.getJSON('/AjaxSwitchDynamicInfo/GetPortUsedCount.cspx', { switchId: id, portName: obj[i].name }, function (objj) { uphtml += getImgHtml(firChar, obj[i], "up", len, i, mknum, obj[i].num, objj); });