Skip to content

Instantly share code, notes, and snippets.

View EugeneZheleznov's full-sized avatar
👨‍💻
Working from home

Eugene EugeneZheleznov

👨‍💻
Working from home
View GitHub Profile
@EugeneZheleznov
EugeneZheleznov / .js
Last active March 31, 2022 08:59
[ajax отправка формы на email с помощью jQuery и php] #php #js #ajax
$(document).ready(function() { // вся магия после загрузки страницы
$("#ajaxform").submit(function(){ // перехватываем все при событии отправки
var form = $(this); // запишем форму, чтобы потом не было проблем с this
var error = false; // предварительно ошибок нет
form.find('input, textarea').each( function(){ // пробежим по каждому полю в форме
if ($(this).val() == '') { // если находим пустое
alert('Заполните поле "'+$(this).attr('placeholder')+'"!'); // говорим заполняй!
error = true; // ошибка
}
});
@EugeneZheleznov
EugeneZheleznov / .css
Created February 3, 2020 07:03
[Отложенная загрузка изображений] Загрузка изображений с помощью Intersection Observer API #lazy #js
* {
font-family: sans-serif;
}
#container {
font-size: 20px;
line-height: 30px;
max-width: 600px;
}