Я использую
Код: Выделить всё
json_encode
Now I'm working with a upload script and I try to return some JSON data after file upload.
I have the following code:
Код: Выделить всё
print_r($result); // 54
[feedback] => Array
(
[message] => File uploaded
[success] => 1
)
)
// Echo result
{"logo_url":"http:\/\/mysite.com\/uploads\/gallery\/7f\/3b\/f65ab8165d_logo.jpeg","img_id":"54","feedback":{"message":"File uploaded","success":true}}
Код: Выделить всё
json_encode
update
@Quentin said that something is happening between
Код: Выделить всё
json_encode
Код: Выделить всё
.parseJSON
Doing a
Код: Выделить всё
alert(data.toSource());
Код: Выделить всё
({response:"{\"logo_url\":\"http:\\/\\/storelocator.com\\/wp-content\\/uploads\\/gallery\\/7f\\/3b\\/71b9520cfc91a90afbdbbfc9d2b2239b_logo.jpeg\",\"img_id\":\"62\",\"feedback\":{\"message\":\"File uploaded\",\"success\":true}}", status:200})
Код: Выделить всё
status:200
Could it be that the
Код: Выделить всё
Plupload bind
This is my js script:
Код: Выделить всё
uploader.bind('FileUploaded', function(up, file, data) {
alert(data.toSource());
$('#' + file.id + " b").html("100%");
});
Источник: https://stackoverflow.com/questions/103 ... ackslashes