This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/scripts/execute-function/weatherRequest_DOM.js

16 lines
492 B
JavaScript

import { weatherRequest } from '../functions/fonctions_principales/weatherRequest_Function.js';
$(function () {
$("#weatherForm").submit((event) => {
event.preventDefault();
const city = $('#cityName').val();
const cityName = city.split(' ').join('+');
const data = `city=${cityName}`;
if(isEmptyValue(cityName)) {
$('.results').html(emptyMessageError);
}
else {
weatherRequest(data);
}
});
});