当前位置:编程学习 > JAVA >>

struts json图片显示问题


                callbacks:{
                onComplete: function(id, fileName, responseJSON) {
                  if (responseJSON.success) {
                  
                  $('#fff').append('<img src="" alt="">');
  
                   alert(responseJSON.allpath);
                      }                  
                }
                },
                debug: true
            });
  
高手帮忙看看responseJSON.allpath 是json的返回的图片路径,
我怎么显示图片呢
  $('#fff').append('<img src="responseJSON.allpath" alt="">');不行
  $('#fff').append('<img src=responseJSON.allpath alt="">');也不行
struts json --------------------编程问答-------------------- var scr=responseJSON.allpath;
  $('#fff').append("<img src="+scr+" alt="">"); --------------------编程问答--------------------
引用 1 楼 rui888 的回复:
var scr=responseJSON.allpath;
  $('#fff').append("<img src="+scr+" alt="">");
,另外看下路径是不是你要的路径,页面中的<base href="<%=basePath%>"/>如果没有的话要考虑相对路径是否正确 --------------------编程问答-------------------- 别把responseJSON.allpath写在引号里边呀。不然当做字符串了。 --------------------编程问答--------------------
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,