我试图在提交表单数据后处理来自 php 文件的数组,提交表单后的数据值为 = ARRAY 但我不能以任何方式使用这个数组,知道如何处理这个数组!!!!
Javascript:
$('#file').live('change',function(){
$('#preview').html('');
$('#preview').html('<img src="loader.gif" />');
$('#data').ajaxForm(function(data){
$(data['toshow']).insertBefore('.pic_content').hide().fadeIn(1000);
}).submit();
});
PHP:
....
....etc
echo json_encode(array('toshow'=>somedata,'data'=>somedata));
JSON字符串来自服务器
{"toshow":"\r\n\t\t\t\t\r\n\t\t<table class=\"out\">\r\n\t\t\t<tr ><td class=\"img\"><a title=\"2012-06-02 01-22-09\" rel=\"prettyPhoto\" href=\"img\/2012-06-02 01-22-09.284.jpg\"><img src=\"img\/thumb\/2012-06-02 01-22-09.284.jpg\"\/><\/a><\/td><\/tr>\r\n\t\t\t\r\n\t\t\t<td>\r\n\t\t\t\t<table cellSpacing=\"1\" cellPadding=\"0\">\r\n\t\t\t\t\t<tr><td class=\"data\"><span class=\"click\">2012-06-02 01-22-09<\/span><\/td><\/tr>\r\n\t\t\t\t\t<tr><td class=\"data\"><span class=\"click\">Download<\/span><\/td><\/tr>\r\n\t\t\t\t\t<tr><td class=\"data\"><a href=\"img\/2012-06-02 01-22-09.284.jpg\"><span class=\"click\">View<\/span><\/a><\/td><\/tr>\r\n\t\t\t\t<\/table>\r\n\t\t\t<\/td>\r\n\t\t\t<\/tr>\r\n\t\t<\/table>","span":"<span class='text'><img src='greencheck.png'\/>2012-06-02 01-22-09 Uploaded ,File Size =152Kb <\/span>"}