A download request is sent and the echo returns a response in the form of html. If its size is 1.5 Kb, the progress bar works. At a size of 75 KB, lengthComputable returns false .
Why isn't the size of the downloadable response being determined or what am I doing wrong?
Js
$.ajax({ url: 'page.php', xhrFields: { onprogress: function(e) { /* set progressbar value */ console.log(e.loaded); console.log(e.lengthComputable); } }, type: 'POST', data: {'page': id}, success: function(data) { content.append(data); } });
Php
if(isset($_POST['page'])) { // Извлечение данных из базы и формирование блока с элементами echo '<div class="item">...</div>'; }