Jquery File Upload SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data
file-upload, jquery, php
Solution
The "response to a request" that you show is not valid JSON because of the text after the closing ].
If you can change your PHP to not return everything after the closing ] you'll have valid JSON.
The "unexpected non-whitespace character" is the / in /home/m/etc after the closing ]
I delete part code when write /home/m/malishkaru/public_html/function/blueimp-jQuery-File-Upload/server/php and all worked.
P.S.: thanks nnnnnn.
P.P.S.: answer for close question only. user nnnnnn give good answer.
Problem
I want use prduct but when upload image i see error SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data ``` script directory: Folder2 directory Jquery-file-upload: function/blueimp-jQuery-File-Upload/ in main.js i edit rows $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: 'server/php/' }); ``` on ``` $('#fileupload').fileupload({ // Uncomment the following to send cross-domain cookies: //xhrFields: {withCredentials: true}, url: '../function/blueimp-jQuery-File-Upload/server/php/' }); ``` Image true save on server, but error with show him after upload. Step1 http://s55.radikal.ru/i149/1211/10/8c8d911589de.jpg Step2 with error http://s019.radikal.ru/i604/1211/8c/7e05d92b30ef.jpg furebug response to a request ``` [{"name":"1353755388.jpg","size":879394,"type":"image\/jpeg","url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/files\/1353755388.jpg","thumbnail_url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/files\/thumbnail\/1353755388.jpg","upload_to_db":true,"delete_url":"http:\/\/malish-ka.ru\/function\/blueimp-jQuery-File-Upload\/server\/php\/?file=ExPRoG-1353755388.jpg","delete_type":"DELETE"}]/home/m/malishkaru/public_html/function/blueimp-jQuery-File-Upload/server/php ``` Tell me please why i have this error? When error?