Reorganizacja struktury plików frontendu
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 201 KiB |
Before Width: | Height: | Size: 434 KiB After Width: | Height: | Size: 434 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 576 KiB After Width: | Height: | Size: 576 KiB |
@ -14,31 +14,18 @@
|
||||
let req = new XMLHttpRequest();
|
||||
let url = "";
|
||||
|
||||
req.open("POST", url, true);
|
||||
req.open("GET", url, true);
|
||||
|
||||
req.setRequestHeader("Content-Type", "application/json");
|
||||
|
||||
// Create a state change callback
|
||||
//req.onreadystatechange = function () {
|
||||
// if (req.readyState === 4 && req.status === 200) {
|
||||
//
|
||||
// Print received data from server
|
||||
// result.innerHTML = this.responseText;
|
||||
// }
|
||||
// };
|
||||
req.onreadystatechange = function () {
|
||||
if (req.readyState === 4 && req.status === 200) {
|
||||
|
||||
var data = JSON.stringify({
|
||||
fuel_type: fuel_type.value,
|
||||
seats: seats.value,
|
||||
doors: doors.value,
|
||||
maximum_price: maximum_price.value,
|
||||
max_years_old: max_years_old.value,
|
||||
engine_power: engine_power.value,
|
||||
car_type: car_type.value,
|
||||
gearbox: gearbox.value,
|
||||
drive_type: drive_type
|
||||
});
|
||||
Print received data from server
|
||||
result.innerHTML = this.responseText;
|
||||
}
|
||||
};
|
||||
|
||||
req.send(data);
|
||||
}
|
||||
|