0
 <img id="lotImgtemp" src="" height="148px" width="200px" border="0">
    var photonames=$("#loyaltymemPhoto").val();     //1.jpg         
    $("#lotImgtemp").attr("src","localhost/sumerdia/uploaded_photos/'+ photonames +'");

如何将值添加到 img src ?

输出我得到相同的 "localhost/sumerdia/uploaded_photos/'+ photonames +'"

我需要的输出是"localhost/sumerdia/uploaded_photos/1.jpg"

4

1 回答 1

2

代替

$("#lotImgtemp").attr("src","localhost/sumerdia/uploaded_photos/'+ photonames +'");

尝试

$("#lotImgtemp").attr("src","localhost/sumerdia/uploaded_photos/"+ photonames);
于 2012-06-19T08:30:53.113 回答