procedure TMainForm.EnterButtonOnClick(Sender: TObject);
var
Forms: array of TForm;
begin
SetLength(Forms, 4);
Forms[0] := RegistrarForm;
Forms[1] := ManagerForm;
Forms[2] := DoctorForm;
Forms[3] := AccountantForm;
Forms[Combobox.ItemIndex].ShowModal();
end;
res.data.data.sort((a, b) => a.place - b.place);
res.data.data.forEach((item) => {
message += item.nickname + ' - Место ' + item.place + '\n';
});
.append($big = $('<img />').attr('src', $this.attr($this.is('img') ? 'data-src' : 'href')).css('position', 'absolute'))
Если код, приведенный вами, выполнится одновременно несколькими запросами, то в результате и добавлений будет ровно столько, сколько запросов пришло одновременно.
pushProduct
const res = await models.product.getByCode(code);
let product = this.products.find((item) => res.code === item.code);
if (product) {
product.count = count;
} else {
this.products.push(res);
}
await this.pushProduct(data.code, data.count);
$('.comics img').each(function() {
let domains = [
'https://domain1.ru',
'https://domain2.ru',
'https://domain3.ru',
'https://domain4.ru',
'https://domain5.ru'
];
let src = $(this).attr('data-src');
for (let i = 0, l = domains.length; i < l; i++) {
if (src.startsWith(domains[i])) {
$(this).attr('data-src', src.replace(domains[i], 'https://anotherdomain.ru/blabla/blabla/'));
break;
}
}
});
$('.comics img').each(function() {
const DOMAIN = 'https://domain.ru';
let src = $(this).attr('data-src');
if (!src.startsWith(DOMAIN)) return;
$(this).attr('data-src', src.replace(DOMAIN, 'https://anotherdomain.ru/blabla/blabla/'));
});
$('.comics img').each(function() {
let src = $(this).attr('data-src');
$(this).attr('data-src', src.replace('https://domain.ru', 'https://anotherdomain.ru/blabla/blabla/'));
});