شرح صفوف ومحتوى الفقرة
لإرسال طلب request إلى الخادم server ، يمكنك استخدام الدالتين open () و send () لل "object" التالي XMLHttpRequest
HTML
xhttp.open("GET", "ajax.txt");
xhttp.send();
Example
HTML
/* Create an XMLHttpRequest object */
const xhttp = new XMLHttpRequest();
/* Define a callback function */
xhttp.onload = function() {
/* Here you can use the Data */
}
/* Send a request */
xhttp.open("GET", "/files/ajax.txt");
xhttp.send();