document.addEventListener('DOMContentLoaded', function() { var fileId = document.getElementById('fileTracker').getAttribute('data-file-id'); if (fileId) { fetch(`https://stats.bunkr.ru/api/file/stats/${fileId}`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, }) .then(response => response.json()) .then(data => console.log('Success:', data)) .catch((error) => console.error('Error:', error)); } });