Uploadify를 사용한 후 JSON 데이터를 반환하는 데 문제가 있습니다.json 반환 데이터가 IE 또는 Chrome에서 작동하지 않습니다.
이 코드는 Firefox에서 작동하지만 IE 9 또는 Chrome에서는 작동하지 않습니다.
이 Uploadify에 대한 스크립트 스크립트입니다
jQuery("#uploadify_gallery").uploadify({
'queueID' : 'fileQueue',
'uploader' : siteURL + '/wp-content/plugins/uploadify/uploadify.swf',
'script' : siteURL + '/wp-content/plugins/uploadify/uploadify_gallery.php',
'fileExt' : '*.jpg;*.jpeg;*.png',
'auto' : true,
'multi' : true,
'method' : 'POST',
'buttonImg' : siteURL + '/wp-content/themes/storelocator/img/buttons/img_upload_grey_bg.png',
'cancelImg' : siteURL + '/wp-content/plugins/uploadify/cancel.png',
'queueSizeLimit' : 20,
'scriptData' : {'entity':jQuery('#entity').val(),'entity_id':jQuery('#entity_id').val()},
'onComplete' : function(event, queueID, fileObj, response, data) {
alert('test'); // <-- THIS WORKS
//This makes the json response readable
var result = eval("(" + response + ")");
alert(result.toSource()); // <-- this never fires
},
});
이다 내가 uploadify_gallery.php
에와 테스트 코드 :
$res = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
echo json_encode($res);
이 어제 일을하고, 나는 그것이
작업을 주 잖아 내가 어떻게이 일을 할 수 있는지에 대한 제안?
평가가 잘못되었습니다. 모든 비용을 들이지 않고 피하십시오. 또한 서버가 스크립트로 반환하는 JSON은 어떻게 생겼을까요? – GordonM