看板 Web_Design 關於我們 聯絡資訊
if (!http_request) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } var URL1 = "url1.txt"; http_request.onreadystatechange = alertContents; http_request.open('GET', URL1, true); http_request.send(null); var URL2 = "url1.txt"; http_request.onreadystatechange = alertContents; http_request.open('GET', URL2, true); http_request.send(null); ...... 想請問一下 我想用ajax讀多檔(2~10+) 但是好像只會出現最後一個檔案的結果 我該修正哪邊呢 -- 5L36f6d6I5207573K657273206f6E62066Y697265O666f78206172U65207375636b2e -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.240.54.152
s25g5d4:你的每個request改變的都是同一個XmlHttpRequest物件 01/15 21:50
s25g5d4:都然會蓋掉前一個request... 01/15 21:50
s25g5d4:用迴圈的方式建立多個XHR物件然後一個一個呼叫 01/15 21:50
sicao:是指宣告多個http_request嗎 那alertContents可以一個就好?? 01/16 00:49
s25g5d4:看你的alertContents怎麼寫阿... 01/16 10:46