我現(xiàn)在使用的是function ajax(i,p,f){ var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"); x.open(p?'POST':'GET',i,1); x.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); x.send(p||''); if(f)x.onreadystatechange=f;}這樣用是異步執(zhí)行的,如何改為同步執(zhí)行?
js如何同步執(zhí)行ajax
眼眸繁星
2018-08-07 11:10:40