$( document ).ready(function() { const errors = ""; if(errors !== '') showInq(errors); $('#inquiry').on('click', function(e){ e.preventDefault(); showInq(null); }); }); function showSuccess() { $.alert({ title: 'Успех', content: 'Запитването е направено успешно.' }); } function showInq(errors) { $.confirm({ boxWidth: '30%', title: 'Запитване', content: 'url:/properties/ajax/inquiry/?slug=&name=', onContentReady: function () { if(errors !== '') this.$content.find('form > div:first-child').before('