I'm basically trying to check the progress of the file download. To do this, I am repeatedly voting on a php file (progress_sess.php) which is changing the session value in the file that handles downloads (export.fp). So there is an Ajax request to request many Ajax requests for export.php and progress_sess.php In this way I am able to demonstrate this step that the file download script is currently in. All are working well in Chromium. Which is clear from the request, you can see the image here: -
But this error has been thrown in Firefox: -
JSON.parse: end of unexpected data You can see: - When I resonate xhr.responseText in Firefox, it gives this: -
""
Probably in Chromium because You can see in the image, the request is application / JSON, as specified in the progress_sess.php header, while the first request in Firefox is something irrelevant reason for the text / plain ?! So I do not understand why Firefox is getting a text / plain response title.
You can see progress_sess.php: -
& lt ;? Php session_id ($ _ cookie ['phpMyAdmin']); Session_start (); Header ("content-type: application / jsan"); $ Result = $ _SESSION ['export_progress']; If ($ result == zero) {$ result = ''; } $ Arr = array (progress_result = & gt; $ result, source = & gt; 'progress_sess.php'); Echo json_encode ($ arr); ? & Gt;
So basically it is impossible that there is something wrong with my Jason, I think my question is that when I have explicitly specified the header, then why is it a Jason Parse error? Throwing? This is due to the text / plain request header, or because of some Ajax difference between Firefox and Chromium.
No comments:
Post a Comment