var sieve_presetsElem = document.getElementById("sieve_presets"); if (sieve_presetsElem) { $.ajax({ dataType: 'json', url: '/api/v1/get/presets/sieve', jsonp: false, complete: function (data) { if (data.responseText !== '{}') { var sieveMailboxPresets = JSON.parse(data.responseText); if (sieveMailboxPresets) { sieve_presetsElem.innerHTML = ''; sieveMailboxPresets.forEach(function (item, index) { var elemID = 'sieve_preset_' + index; sieve_presetsElem.innerHTML += '